• Dana Fried's avatar
    FlexLayout distributes space optimally. · f0998e38
    Dana Fried authored
    This changes long-standing problems with FlexLayout that were not
    problems with BoxLayout. Specifically:
     - Flex weights now dictate deviation from a view's preferred size
       (which may now be zero), so that when a view with a FlexLayout
       shrinks, its flex children shrink proportionately, just as they grow
       proportionately when the host view enlarges.
     - When a child view hits its minimum size or drops out, remaining space
       is correctly allocated across other child views, even at the same
       flex priority.
    
    This solves a number of weird corner cases and rounding issues at the
    result of a bit more complexity. However, the code is more heavily
    documented and broken into steps so the net effect is that it should be
    relatively maintainable.
    
    Bug: 1012134, 1012113
    
    Change-Id: Idc3059d572b3d165866b44c077c38d483d862596
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2100026
    Commit-Queue: Dana Fried <dfried@chromium.org>
    Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
    Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#809245}
    f0998e38
composite_layout_tests.cc 34 KB