From efba58b5091e3e4c4d13c5f4c7deda0816152022 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Thu, 19 Aug 2021 12:54:10 +0100 Subject: [PATCH] Another ChartSpace spanning tile fixup .. if a tile moves because it clashes with a spanning tile we need to repeat the process in case it clashes with another after it has been moved. .. previously we moved on the first clash, but ignored any others. --- src/Gui/ChartSpace.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Gui/ChartSpace.cpp b/src/Gui/ChartSpace.cpp index f653fd3cf..3cdfbf8d8 100644 --- a/src/Gui/ChartSpace.cpp +++ b/src/Gui/ChartSpace.cpp @@ -477,9 +477,12 @@ repeat: int add = 0; //XXX PERFORMANCE ISSSE XXX (state == DRAG) ? (ROWHEIGHT/2) : 0; // check we don't overlap with any spanning items in earlier columns etc - foreach(QRectF spanner, spanners) { - if (spanner.intersects(QRect(tx,ty,twidth,theight+SPACING))) - ty = spanner.bottomLeft().y() + SPACING; +again: + for(int j=0; j< spanners.count(); j++) { + if (spanners[j].intersects(QRect(tx,ty,twidth,theight+SPACING))) { + ty = spanners[j].bottomLeft().y() + SPACING; + goto again; + } } // for setting the scene rectangle - but ignore a ChartSpaceItem if we are dragging it