diff options
| author | Florian Barbin | 2014-09-09 14:43:12 +0000 |
|---|---|---|
| committer | Florian Barbin | 2014-09-18 14:35:10 +0000 |
| commit | c8b9c32ec7a1cd98d6c485aac7492341e972eb7a (patch) | |
| tree | d673dc4908ce5639094c2d24003324c3032921b5 | |
| parent | f9e3c2d55727e9f866a9a8e54fc6e5b60d3afc99 (diff) | |
| download | org.eclipse.sirius-c8b9c32ec7a1cd98d6c485aac7492341e972eb7a.tar.gz org.eclipse.sirius-c8b9c32ec7a1cd98d6c485aac7492341e972eb7a.tar.xz org.eclipse.sirius-c8b9c32ec7a1cd98d6c485aac7492341e972eb7a.zip | |
[443108] Handle the scroll size within getAbsoluteBoundsIn100Percent
Bug: 443108
Change-Id: I56472ee5045224316984395b41ab2bd46ea1f316
Signed-off-by: Florian Barbin <florian.barbin@obeo.fr>
| -rw-r--r-- | plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/editparts/GraphicalHelper.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/editparts/GraphicalHelper.java b/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/editparts/GraphicalHelper.java index 0a885d1592..a8c9dcae47 100644 --- a/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/editparts/GraphicalHelper.java +++ b/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/editparts/GraphicalHelper.java @@ -166,7 +166,7 @@ public final class GraphicalHelper { * an edit part on the view * @return the scroll size */ - public static Point getScrollSize(IGraphicalEditPart part) { + public static Point getScrollSize(GraphicalEditPart part) { Preconditions.checkNotNull(part); FreeformViewport viewport = FigureUtilities.getFreeformViewport(part.getFigure()); if (viewport != null) { @@ -221,7 +221,7 @@ public final class GraphicalHelper { * @param part * a part from the diagram. */ - public static void screen2logical(Rectangle rect, IGraphicalEditPart part) { + public static void screen2logical(Rectangle rect, GraphicalEditPart part) { rect.translate(GraphicalHelper.getScrollSize(part)); rect.performScale(1.0d / GraphicalHelper.getZoom(part)); } @@ -422,9 +422,8 @@ public final class GraphicalHelper { } /** - * Get the absolute bounds of this <code>part</code>.<BR> - * Detail: If the zoom is set to 200%, the location and the size are - * multiplied by two with respect to the real location and size. + * Get the absolute bounds of this <code>part</code>. In case of zoom or/and + * a scrollbar, the bounds are converted from screen to logical.<BR> * * @param part * The part to consider. @@ -438,7 +437,7 @@ public final class GraphicalHelper { bounds = part.getFigure().getBounds().getCopy(); } part.getFigure().translateToAbsolute(bounds); - bounds.performScale(1.0d / GraphicalHelper.getZoom(part)); + screen2logical(bounds, part); return bounds; } |
