Skip to content

Commit 2eade3c

Browse files
akoch-yattaazoitl
authored andcommitted
Use Rectangle#scale in IScalablePane#getScaledRect
This commit replaces the scaling in IScalablePane#getScaledRect for width and height of a Rectangle with using Rectangle#scale instead.
1 parent 2655fd6 commit 2eade3c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

org.eclipse.draw2d/src/org/eclipse/draw2d/IScalablePane.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ public interface IScalablePane extends ScalableFigure {
3030

3131
public default Rectangle getScaledRect(Rectangle rect) {
3232
double scale = getScale();
33-
rect.width /= scale;
34-
rect.height /= scale;
35-
rect.x /= scale;
36-
rect.y /= scale;
33+
rect.scale(1 / scale);
3734
return rect;
3835
}
3936

0 commit comments

Comments
 (0)