-
Notifications
You must be signed in to change notification settings - Fork 52
Fix improper bounds calculation for MoveHandleLocator when zoomed in #940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix improper bounds calculation for MoveHandleLocator when zoomed in #940
Conversation
The `MoveHandleLocator`shrinks the size of the target figure by one, handles the insets and then expands it by one again. The problem is that the first operation is done before translating the bounds to absolute coordinates. Instead of shrinking the size by one, it is therefore shrunk by one times the zoom factor. As a result, the bounds of the target figure don't fully enclose the bounds of the figure owned by the locator. To reproduce: Open the Logic editor and select e.g. a Gate. When selecting the element, the selection box doesn't fully enclose the right and bottom of the figure.
azoitl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it be that the -1 +1 thingy somehow wants to address the line border width. However this should be handled by the insets or? Couldn't we remove the -1 +1?
That's what I meant... If you look at how it was originally, the insets were taken into consideration. The +1/-1 was then added for the sake of some "zoom changes", but without any explanation what they're supposed to fix. gef-classic/org.eclipse.gef/src/org/eclipse/gef/handles/MoveHandleLocator.java Lines 43 to 54 in 3e73cf3
I don't see why it was added but I also can't predict the side-effects that would be introduced by removing them. My current guess is that it likely avoids some rounding errors when scaling the figures. All I can say is that it not a +1/-1, but rather a +1/(-1*zoom), which is causing these artifacts. |
Me neither. I only fear that now that you changed it to PrecisionRectangle that we have now more or different rounding issues and that the +1/(-1*zoom) adds to that. However I have no clue how to find that out. |
I'm not sure what you mean. The class was using a |
azoitl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm stupid.

The
MoveHandleLocatorshrinks the size of the target figure by one, handles the insets and then expands it by one again. The problem is that the first operation is done before translating the bounds to absolute coordinates. Instead of shrinking the size by one, it is therefore shrunk by one times the zoom factor.As a result, the bounds of the target figure don't fully enclose the bounds of the figure owned by the locator.
To reproduce: Open the Logic editor and select e.g. a Gate. When selecting the element, the selection box doesn't fully enclose the right and bottom of the figure.