]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Fixed moving elements up/down on diagram 86/4086/1
authorJussi Koskela <jussi.koskela@semantum.fi>
Thu, 2 Apr 2020 10:55:21 +0000 (13:55 +0300)
committerJussi Koskela <jussi.koskela@semantum.fi>
Thu, 2 Apr 2020 10:55:21 +0000 (13:55 +0300)
gitlab #509

Change-Id: I47ab51cb5ff07499ed0637e9f7012ec16c5ae7a7

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);