commit | 3a6cdd45b3404defd9f09d44d5e2e3bb53fd5cf1 | [log] [tgz] |
---|---|---|
author | Dana Fried <dfried@chromium.org> | Wed Feb 13 01:26:12 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Wed Feb 13 01:26:12 2019 |
tree | 404cf9746c977a394e18ca9b7644b8f7811b9c9c | |
parent | c3145779841aa1051d8790d3717b5654ea8641bb [diff] |
Improvements in FlexLayout "stretch" cross-axis alignment handling. Previously, a child view with a very large cross-axis size would cause a layout with cross-axis alignment set to "stretch" to become larger, so child views would be stretched to a size larger than the host view, cutting off the trailing end of the child views. Now, when the cross-axis alignment is set to stretch and a cross-axis size is specified, the layout will be exactly that large in the cross-axis dimension. The only exception is if a minimum cross-axis size is specified, or the interior margines would be too large to fit in the available space. Example: Vertical layout with cross-axis set to stretch. Host view width = 100. Two child views, one with a width of 120, the other with a width of 50. In the old behavior, the first child would force the layout to 120 DIPs and both views would stretch to that size. +-------------------+ | Host view | |+-----------------------+ || Child view 1 | |+-----------------------+ |+-----------------------+ || Child view 2 | |+-----------------------+ +-------------------+ In the new behavior, the layout would be forced to fit in exactly the size of the host view, setting them both to 100 DIPs. +-------------------+ | Host view | |+-----------------+| || Child view 1 || |+-----------------+| |+-----------------+| || Child view 2 || |+-----------------+| +-------------------+ In nearly all cases, this second behavior is the intended one when stretch is specified, hence the change. Still to do: properly handle GetHeightForWidth() in this case, but that only affects vertical layouts with multiline text and so far there are no known examples using FlexLayout. Bug: 930500 Change-Id: I44aa75051406628210751cd1a36040def47996b4 Reviewed-on: https://chromium-review.googlesource.com/c/1461829 Commit-Queue: Dana Fried <dfried@chromium.org> Reviewed-by: Bret Sepulveda <bsep@chromium.org> Cr-Commit-Position: refs/heads/master@{#631485}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .