]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Fixed moving elements up/down on diagram 64/4064/1
authorJussi Koskela <jussi.koskela@semantum.fi>
Thu, 2 Apr 2020 10:55:21 +0000 (13:55 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 2 Apr 2020 19:58:17 +0000 (19:58 +0000)
gitlab #509

Change-Id: I47ab51cb5ff07499ed0637e9f7012ec16c5ae7a7
(cherry picked from commit 06ba87c8c0f66b8d198eaad24a98442a9d3bc581)

bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/participant/ZOrderHandler.java

index 007d039f23715e4ec65446739c8cc941cbe80cd5..8b893a2b1e7f0730fac80482cd67feb7ae1e115d 100644 (file)
@@ -86,8 +86,8 @@ public class ZOrderHandler extends AbstractDiagramParticipant {
                         int index = elements.indexOf(e);
                         if (index != -1 && selectedElements.contains(e)) {
                             changed |= diagram.moveTo(e, nextPos);
-                            nextPos = index;
                         }
+                        nextPos = index;
                     }
                     if (changed) {
                         notifyZOrderListeners(diagram);
@@ -121,8 +121,8 @@ public class ZOrderHandler extends AbstractDiagramParticipant {
                         int index = elements.indexOf(e);
                         if (index != -1 && selectedElements.contains(e)) {
                             changed |= diagram.moveTo(e, nextPos);
-                            nextPos = index;
                         }
+                        nextPos = index;
                     }
                     if (changed) {
                         notifyZOrderListeners(diagram);