371760: Support revealing nested figures
Fix for scrolling and zooming issues:
Moved translation to cover all cases properly. Mouse events all operate
on absolute coordinates now, and getTargetFigures(...) converts into
viewport system.
Bug: 371760
Change-Id: If820a6f4486496ae73ea5a141564ae03f55da89d
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=371760
diff --git a/org.eclipse.mylyn.mft.gmf.ui/src/org/eclipse/mylyn/mft/gmf/ui/RevealMouseListener.java b/org.eclipse.mylyn.mft.gmf.ui/src/org/eclipse/mylyn/mft/gmf/ui/RevealMouseListener.java
index d4a8a00..cf2d739 100644
--- a/org.eclipse.mylyn.mft.gmf.ui/src/org/eclipse/mylyn/mft/gmf/ui/RevealMouseListener.java
+++ b/org.eclipse.mylyn.mft.gmf.ui/src/org/eclipse/mylyn/mft/gmf/ui/RevealMouseListener.java
@@ -43,6 +43,7 @@
private Collection<IRevealableFigure> getTargetFigures(Point mousePoint) {
Rectangle revealBounds = new Rectangle(mousePoint, new Dimension(REVEAL_DISTANCE * 2, REVEAL_DISTANCE * 2));
+ layer.translateFromParent(revealBounds);//translate into viewport's client area coordinates
revealBounds.translate(-REVEAL_DISTANCE, -REVEAL_DISTANCE);
HashSet<IRevealableFigure> found = new HashSet<IRevealableFigure>();
findChildFigure(layer, revealBounds, found);
@@ -120,7 +121,6 @@
public void mouseMove(MouseEvent e) {
Point mousePoint = new Point(e.x, e.y);
- layer.translateFromParent(mousePoint);
Collection<IRevealableFigure> newDecorations = getTargetFigures(mousePoint);
if (!newDecorations.equals(lastDecorations)) {