fix: SText.updateMeasuredBounds() mutates defensive copy instead of internal state #32
Reference in New Issue
Block a user
Delete Branch "fix/issue-27-stext-update-measured-bounds"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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().
a8b908ca1dto873f5d2711