Blueprint
Blueprint copied to clipboard
Cascade rounding correction to nested layouts
This is a fix for a new twist on an old classic: frame rounding that causes labels to be truncated.
This time the issue issue appears in nested BlueprintViews. In a "flat" element composition, labels' frame rounding behavior prioritizes sizes over edge alignment to avoid this issue. However, when we have a nested BlueprintView, it acts as a leaf node to the outer BlueprintView, and the layout is effectively broken into two stages. This breaks the rounding error accumulation/correction, and prevents the size prioritization from working.
The fix works like this:
- Rounding correction info is extended to include size correction in addition to origin.
- Correction info is cascaded across nested BlueprintViews through internal environment keys.
- Nested BlueprintViews apply the correction: a. the size is applied during layout, so that layout happens in the same bounds it would have in a flat composition b. the origin is applied during rounding, so that rounding behavior can also match a flat composition
New pixel boundary snapshot tests validate the expected behavior: both existing tests now run in a "flat" mode and a "nested" mode, where the latter has intermediate BlueprintViews added to the tree. We expect to get the same result in both cases.
There's also a new test for size priority frame rounding, since there didn't seem to be one before.
See UI-2676