Bug 359222 - Incorrect location after move of
FixPointAnchor/BoxRelativeAnchor
diff --git a/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/features/impl/DefaultMoveAnchorFeature.java b/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/features/impl/DefaultMoveAnchorFeature.java
index 0ddb94d..de075ef 100644
--- a/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/features/impl/DefaultMoveAnchorFeature.java
+++ b/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/features/impl/DefaultMoveAnchorFeature.java
@@ -25,6 +25,7 @@
import org.eclipse.graphiti.features.context.IMoveAnchorContext;
import org.eclipse.graphiti.internal.Messages;
import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
+import org.eclipse.graphiti.mm.pictograms.AdvancedAnchor;
import org.eclipse.graphiti.mm.pictograms.Anchor;
import org.eclipse.graphiti.mm.pictograms.AnchorContainer;
import org.eclipse.graphiti.mm.pictograms.BoxRelativeAnchor;
@@ -79,6 +80,11 @@
*/
protected void moveAnchor(Anchor anchor, int posX, int posY) {
+ if (anchor instanceof AdvancedAnchor) {
+ posX -= anchor.getGraphicsAlgorithm().getX();
+ posY -= anchor.getGraphicsAlgorithm().getY();
+ }
+
if (anchor instanceof FixPointAnchor) {
FixPointAnchor fpAnchor = (FixPointAnchor) anchor;
fpAnchor.setLocation(Graphiti.getGaCreateService().createPoint(posX, posY));