fix: SText.updateMeasuredBounds() mutates defensive copy instead of internal state #32

Merged
thib8956 merged 1 commits from fix/issue-27-stext-update-measured-bounds into master 2026-03-27 23:22:21 +00:00
Owner

Closes #27

Problem

SText.updateMeasuredBounds() called getBounds() which returns a defensive copy (new Rectangle(this.bounds)), then called setSize() on that copy. The internal bounds field was never updated.

Fix

Use the protected bounds field directly instead of getBounds().

Tests

Added 4 regression tests to STextTest verifying that updateMeasuredBounds() actually persists to getBounds().

Closes #27 ## Problem SText.updateMeasuredBounds() called getBounds() which returns a defensive copy (new Rectangle(this.bounds)), then called setSize() on that copy. The internal bounds field was never updated. ## Fix Use the protected bounds field directly instead of getBounds(). ## Tests Added 4 regression tests to STextTest verifying that updateMeasuredBounds() actually persists to getBounds().
thib8956 added 1 commit 2026-03-27 23:22:10 +00:00
fix: SText.updateMeasuredBounds() must mutate internal bounds, not defensive copy
All checks were successful
CI / build-and-test (pull_request) Successful in 17s
873f5d2711
Closes #27
thib8956 force-pushed fix/issue-27-stext-update-measured-bounds from a8b908ca1d to 873f5d2711 2026-03-27 23:22:10 +00:00 Compare
thib8956 merged commit 5415c10c26 into master 2026-03-27 23:22:21 +00:00
thib8956 deleted branch fix/issue-27-stext-update-measured-bounds 2026-03-27 23:22:21 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: thib8956/new-shapes#32