Skip to content

normalize rotate and tile angle modulo 360 to avoid 32-bit truncation - #4637

Merged
lovell merged 1 commit into
lovell:mainfrom
metsw24-max:rotate-tile-angle-normalize
Oct 19, 2026
Merged

lovell merged 1 commit into
lovell:mainfrom
metsw24-max:rotate-tile-angle-normalize

Conversation

@metsw24-max

Copy link
Copy Markdown
Contributor

Rotate angle truncated to 32-bit before the modulo

rotate() and tile({ angle }) accept any integer multiple of 90 but store it unchanged, and the reduction modulo 360 only happens natively, after the value has gone through AttrAsInt32. A multiple of 90 that is a valid JS integer yet larger than the signed 32-bit range, such as 90 * 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. isRotationExpected already works modulo 360, so the two layers disagree about what was asked for. Normalised the stored angle to angle % 360 at both call sites, the same way hue is already handled, so the value reaching the native int field is always in range and mathematically equivalent.

@lovell
lovell merged commit 1b8fcda into lovell:main Oct 19, 2026
33 checks passed
@lovell

lovell commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Thank you

@lovell lovell added this to the v0.35.6 milestone Oct 19, 2026
lovell added a commit that referenced this pull request Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants