QuickLayout/Sources
Mark Davis e7caec9ab2 Fix UILabel.proxy stale paragraph style causing incorrect sizing
Summary:
Both `UILabel.proxy` variants (text-based and attributed-text-based) shared a single static `sizingLabel`. When the attributed text variant set an `NSAttributedString` carrying paragraph style properties like `minimumLineHeight` (e.g. from `BCNAttributedString`), UIKit retained those properties internally on the label — even after subsequent text-based proxy calls set `attributedText = nil` and reassigned `text` + `font`. This caused stale paragraph style properties to inflate subsequent text-based proxy measurements. For example, a stale `minimumLineHeight` of 25pt (from a 20pt bold header) would cause a 13pt label (natural height ~15.67pt) to be measured at 25pt.

The fix: use a dedicated `attributedSizingLabel` for the attributed text proxy, so the two code paths never share state and paragraph style properties can't leak between them.

Reviewed By: constantine-fry

Differential Revision: D96003413

fbshipit-source-id: 02378a04cb2dd86679053b1608bef5b2e2fdfe3d
2026-03-11 10:42:13 -07:00
..
FastResultBuilder/FastResultBuilder Initial commit 2025-11-14 14:11:10 -08:00
QuickLayout Fix UILabel.proxy stale paragraph style causing incorrect sizing 2026-03-11 10:42:13 -07:00