Skip to content

Build Rectangle negation via canonical constructor - #23

Merged
tobydriscoll merged 2 commits into
masterfrom
fix-rectangle-negation
Jun 30, 2026
Merged

Build Rectangle negation via canonical constructor#23
tobydriscoll merged 2 commits into
masterfrom
fix-rectangle-negation

Conversation

@tobydriscoll

Copy link
Copy Markdown
Member

Negating a Rectangle went through the lowercase rectangle(-vertices(r)) builder, while every other arithmetic op (+/- with a scalar) uses the canonical Rectangle(center, radii, rotation) constructor directly.

Negation is a point reflection through the origin: center -> -center, with radii and rotation unchanged (the vertex-offset set is closed under negation). So it can use the canonical constructor too, making the arithmetic operations internally consistent. Verified the result has identical vertices to the previous implementation.

🤖 Generated with Claude Code

tobydriscoll and others added 2 commits June 30, 2026 11:57
Negating a Rectangle went through the lowercase rectangle(-vertices(r))
builder, while every other arithmetic op uses Rectangle(center, radii,
rotation) directly. Negation is a point reflection through the origin:
center -> -center, radii and rotation unchanged (the vertex-offset set
is closed under negation), so it can use the canonical constructor too.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tobydriscoll
tobydriscoll merged commit aa79795 into master Jun 30, 2026
4 checks passed
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.

1 participant