Skip to content
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 rectangle snapping #2768

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

edwloef
Copy link
Contributor

@edwloef edwloef commented Jan 30, 2025

fixes #2753

Before, the whole rectangle was moved towards the top left (to align the top left point), then the bottom right point was aligned after being moved up. Now the top left point is aligned independently of the bottom right point.

@edwloef edwloef force-pushed the fix_rectangle_snap branch from e10a687 to 2e7cc25 Compare January 31, 2025 21:01
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should consider rounding instead of flooring?

core/src/rectangle.rs Outdated Show resolved Hide resolved
@hecrj hecrj added this to the 0.14 milestone Jan 31, 2025
@hecrj hecrj added bug Something isn't working rendering fix labels Jan 31, 2025
@edwloef
Copy link
Contributor Author

edwloef commented Jan 31, 2025

Maybe we should consider rounding instead of flooring?

I don't think that truncate is less correct than rounding in this case, either should be fine. Truncate seems more intuitive to me though since it is the default way of casting float to int.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix rendering
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Horizontal scrollable off-by-one error?
2 participants