[NUI] Fix GridLayout to calculate child's size proportional to span
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Thu, 14 Oct 2021 11:14:48 +0000 (20:14 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 9 Nov 2021 05:57:53 +0000 (14:57 +0900)
Previously, child's size was not proportional to its span.
e.g. width of span 1 was the same with width of span 2.

Now, child's size is proportional to its span.

src/Tizen.NUI/src/internal/Layouting/GridLocations.cs

index 8659b2c..5dfdfd4 100755 (executable)
@@ -126,7 +126,7 @@ namespace Tizen.NUI
                     Node node = edgeList[i];
                     // update expanded size.
                     if (node.Stretch.HasFlag(StretchFlags.Expand))
-                        node.ExpandedSize = curExpandedSize / totalExpand;
+                        node.ExpandedSize = curExpandedSize * (node.End - node.Start) / totalExpand;
                 }
 
                 // re-init locations based on updated expanded size.