[NUI] Fix to measure GridLayout's children sizes correctly
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Wed, 18 Aug 2021 12:54:00 +0000 (21:54 +0900)
committerhuiyu <35286162+huiyueun@users.noreply.github.com>
Tue, 7 Sep 2021 09:05:39 +0000 (18:05 +0900)
commitff848574702d72faa85c07ee7edf3028606b125d
tree8304940b5d50a658058517f618642e536f1cf536
parent26c325b20024a649cfbcc79049c24b6ce90b1584
[NUI] Fix to measure GridLayout's children sizes correctly

Previously, if child's measured size is 0, then GridLayout does not
update the child's measured size when the child's size is set by using
GridLayout APIs.
e.g.
SetHorizontalStretch(child, GridLayout.StretchFlags.ExpandAndFill);

Moreover, if child has its own size and ExpandAndFill is set, then
child's size is set to be its own size (its measured size) plus its
expanded size.
e.g.
parent size is 100.
child1's measured size is 50 and ExpandAndFill.
child2's measured size is 0 and ExpandAndFill.
Then, child1's size is 50 + 25 = 75 and child2's size is 25.

To resolve the above, GridLayout updates child's measured size in
OnLayout() and child's size is set to be the bigger one between its
measured size and its expanded size.
src/Tizen.NUI/src/internal/Layouting/GridLocations.cs
src/Tizen.NUI/src/public/Layouting/GridLayout.cs