diff options
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/LifelineNodeFigure.java')
-rw-r--r-- | plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/LifelineNodeFigure.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/LifelineNodeFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/LifelineNodeFigure.java index 159687ec9f1..c36d6902b68 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/LifelineNodeFigure.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/figures/LifelineNodeFigure.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2018 CEA LIST and others. + * Copyright (c) 2018 CEA LIST, Christian W. Damus, and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,6 +8,7 @@ * * Contributors: * CEA LIST - Initial API and implementation + * Christian W. Damus - bug 539373 * *****************************************************************************/ @@ -34,10 +35,14 @@ public class LifelineNodeFigure extends SelectableBorderedNodeFigure { @Override public boolean containsPoint(int x, int y) { - if (Math.abs(this.getBounds().x + this.getBounds().width / 2 - x) < 20) { - return super.containsPoint(x, y); // check also the other bounds + // Hit test the lifeline itself with execution specifications + boolean result = getMainFigure().containsPoint(x, y); + if (!result) { + // Try the border items (e.g., time observations) + result = FigureHitTestUtil.INSTANCE.anyChildContainsPoint( + getBorderItemContainer(), x, y); } - return false; + return result; } @Override @@ -45,11 +50,11 @@ public class LifelineNodeFigure extends SelectableBorderedNodeFigure { if (search.prune(this)) { return null; } - IFigure result = getBorderItemContainer().findFigureAt(x, y, search); + IFigure result = FigureHitTestUtil.INSTANCE.findChildAt(getBorderItemContainer(), x, y, search); if (result != null) { return result; } return getMainFigure().findFigureAt(x, y, search); } -}
\ No newline at end of file +} |