-
Notifications
You must be signed in to change notification settings - Fork 148
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
Crop tooltip displays incorrect center coordinates when rotating #1071
Comments
@haferburg It's probably unrelated, but would you mind confirming this on your system? |
Yes, it's also buggy on Ubuntu. The angle starts at +-90 degrees, which is odd. It should start at 0 IMO. It was my suspicion that #944 was caused by adding the rotate functionality. It's a bit unclear to me how rotate is supposed to work, from a design perspective. It's probably: First the (axis-aligned) rectangle is defined, then the rotation is applied. So the (x,y,w,h) coordinates of the rectangle don't change when the rotation changes. |
@haferburg Thanks for confirming! The angle offset is indeed odd. I did not observe any snapping to 0 or 90 degrees. The implementation seems quite similar to the first case you described, but the rotation changes are somehow stored not as an angle, but as a transformation matrix mixed with the center offsetting translations. |
Fixes nomacs#1071 The tooltip of the crop tool displays the center coordinates of the crop rectangle when it is rotated, however, the displayed value changes when we rotate around the center. The value is incorrect because the center is not properly translated before applying the rotation transform, which rotates around the origin. This patch calculates the coordinates to be displayed considering only the translation because rotation around the center should not change its position.
Fixes #1071 The tooltip of the crop tool displays the center coordinates of the crop rectangle when it is rotated, however, the displayed value changes when we rotate around the center. The value is incorrect because the center is not properly translated before applying the rotation transform, which rotates around the origin. This patch calculates the coordinates to be displayed considering only the translation because rotation around the center should not change its position.
Describe the bug
When the crop rectangle is rotated with the drag handle, the tooltip displays the center x and y coordinates. The displayed values change when rotating the rectangle, which is incorrect as the rectangle rotates around the center.
To Reproduce
Expected behavior
The center coordinates should be fixed when rotating the rectangle.
Screenshots
nomacs_crop_rotate.mp4
Desktop:
The text was updated successfully, but these errors were encountered: