[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)
committerJaehyun Cho <jaehyun0cho@gmail.com>
Tue, 19 Oct 2021 08:07:40 +0000 (17:07 +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.