Repository navigation
normalize rotate and tile angle modulo 360 to avoid 32-bit truncation - #4637
Merged
Merged
Conversation
Owner
|
Thank you |
lovell
added a commit
that referenced
this pull request
Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rotate angle truncated to 32-bit before the modulo
rotate()andtile({ angle })accept any integer multiple of 90 but store it unchanged, and the reduction modulo 360 only happens natively, after the value has gone throughAttrAsInt32. A multiple of 90 that is a valid JS integer yet larger than the signed 32-bit range, such as90 * 47721859(270 degrees), truncates to an unrelated value whose remainder is no longer a multiple of 90, so the requested rotation is silently dropped or applied at the wrong angle.isRotationExpectedalready works modulo 360, so the two layers disagree about what was asked for. Normalised the stored angle toangle % 360at both call sites, the same wayhueis already handled, so the value reaching the native int field is always in range and mathematically equivalent.