[NUI] Fix FlexLayout not to fill its parent with WrapContent
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Tue, 10 Aug 2021 12:21:57 +0000 (21:21 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 18 Aug 2021 03:10:44 +0000 (12:10 +0900)
Previously, FlexLayout filled its parent even if it had WrapContent
Width/HeightSpecification.
Because FlexLayout's width and height always referred its parent's size.
(If Width/HeightSpecification is WrapContent, then Mode becomes AtMost.)

Now, FlexLayout does not fill its parent if it has WrapContent
Width/HeightSpecification.

src/Tizen.NUI/src/public/Layouting/FlexLayout.cs

index 1bf8b30..2b37319 100755 (executable)
@@ -729,12 +729,12 @@ namespace Tizen.NUI
             float width = FlexUndefined; // Behaves as WrapContent (Flex Auto)
             float height = FlexUndefined; // Behaves as WrapContent (Flex Auto)
 
-            if (widthMeasureSpec.Mode == MeasureSpecification.ModeType.Exactly || widthMeasureSpec.Mode == MeasureSpecification.ModeType.AtMost)
+            if (widthMeasureSpec.Mode == MeasureSpecification.ModeType.Exactly)
             {
                 width = widthMeasureSpec.Size.AsDecimal();
             }
 
-            if (heightMeasureSpec.Mode == MeasureSpecification.ModeType.Exactly || heightMeasureSpec.Mode == MeasureSpecification.ModeType.AtMost)
+            if (heightMeasureSpec.Mode == MeasureSpecification.ModeType.Exactly)
             {
                 height = heightMeasureSpec.Size.AsDecimal();
             }