Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This fixes 2 bugs that were manifesting in the following scenario: 1. Text object using a font wider than the default font 2. Text object set to autoWidth AND wrap 3. Text object has a parent layout set to Hug In these cases, since text objects initially use the default font (while the actual font loads), the layout would measure the width using the default font, however, once the font loaded, we needed to force another update cycle so we could re-measure and update the layout bounds (which should become wider to accomodate the wider text). Since this was not happening, the result was the wider font sometimes wrapping to the next line because its width was constrained by its parent layout. There are 2 fixes here, once addresses the issue in Dart (simple fix), while the other addresses issues with nested artboards in the editor only (due to dart -> CPP interaction). Regarding the Dart -> CPP fix for nested artboards, the CPP side appeared to be doing things correctly, marking layout dirty when the font was decoded, however, at that time, the RuntimeMountedArtboard has not been instantiated yet, thus the layoutDirty callback (which the CPP side calls in order to indicate to the Dart side that its layout is dirty) was not set. The proposed fix for this is: 1. When the RuntimeMountedArtboard is instantiated, active it's nested artboard so we force an update cycle from the Dart side. 2. When setting the layout dirty callback on the nested artboard's CPP Artboard, add ComponentDirt::Components to prevent updateComponents from earlying out. Diffs= 93e625c1d4 Fix layout update on font load (#9034) Co-authored-by: Philip Chung <[email protected]>
- Loading branch information