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 odd-sized pixel snapping #94625

Closed

Conversation

adamscott
Copy link
Member

Warning

This PR needs to be thoroughly tested before merging it.

This PR makes it so that it doesn't add 0.5 pixels to odd sized items before snapping them.

Fixes #94298.

Tests

@KeyboardDanni
Copy link
Contributor

Are we sure this is the right fix? Do we really want to change the behavior of odd pixels? I'd think we would want consistent rounding behavior for both even and odd pixels. I continue to be of the opinion that we should try to make the rounding behavior as simple as possible so that users aren't dealing with sudden surprises from corner cases.

What about the approach I suggested at #94298 (comment) ?

@KeyboardDanni
Copy link
Contributor

Also the use of fmod here seems incorrect, as it returns a floating point remainder. It'd only perform rounding when the coordinate is exactly aligned with an even pixel, which kind of goes against the whole purpose of pixel rounding to begin with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[4.3beta3] Sprite pivot changed since 4.3beta2
3 participants