Blueprint icon indicating copy to clipboard operation
Blueprint copied to clipboard

Cascade rounding correction to nested layouts

Open watt opened this issue 2 years ago • 0 comments

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:

  1. Rounding correction info is extended to include size correction in addition to origin.
  2. Correction info is cascaded across nested BlueprintViews through internal environment keys.
  3. 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

watt avatar Aug 04 '22 23:08 watt