bug: SText.updateMeasuredBounds() mutates a defensive copy instead of internal state #27
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
In
SText.updateMeasuredBounds(), the callgetBounds().setSize(...)mutates a copy of the bounds rectangle (sincegetBounds()returns a defensive copy) and discards the result. This means resized dimensions are silently lost.Impact: Cloning an
STextthat has been resized will produce a clone with default dimensions instead of the resized ones.Found during: Review of PR #15 (ShapeContractTest). The contract test passes only because the factory creates
STextwith default bounds.Expected fix:
updateMeasuredBounds()should mutate the internalboundsfield directly rather than callinggetBounds().