[NUI] Fix SetSize of ExcludeLayouting with LayoutWidth/Height
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Tue, 25 Mar 2025 12:27:00 +0000 (21:27 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Thu, 27 Mar 2025 00:43:29 +0000 (09:43 +0900)
Previously, ExcludeLayouting case sets layout size only if
Width/HeightSpecification is negative value.
If Width/HeightSpecification is negative value, then it is either
MatchParent or WrapContent instead of fixed size value.
Therefore, calculated layout size should be set to view size.

Now, LayoutWidth/Height is used instead of Width/HeightSpecification.
Width/HeightSpecification sets view size if it is fixed size value.
Unlike Width/HeightSpecification, LayoutWidth/Height does not set view
size although it is fixed size value. View size is set by Layout.

Therefore, the condition that LayoutWidth/Height is not fixed size value
is not the same with the condition that Width/HeightSpecification is not
fixed size value since view size may not be set.

To make the condition same as before, additional condition is added.

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

index 1e8c7fe2a7e4fb77055e74f0e765081f65a7e038..193d079ca1a4c01c554b5acb20a14ec3867d8fa5 100755 (executable)
@@ -601,7 +601,10 @@ namespace Tizen.NUI
                     {
                         // If height or width specification is not explicitly defined,
                         // the size of the owner view must be reset even the ExcludeLayouting is true.
-                        if (!Owner.LayoutWidth.IsFixedValue || !Owner.LayoutHeight.IsFixedValue)
+                        // Unlike Width/HeightSpecification, LayoutWidth/Height does not set view size automatically.
+                        // Therefore, view size should be checked if it is same with LayoutWidth/Height.
+                        if (!Owner.LayoutWidth.IsFixedValue || Owner.LayoutWidth != Owner.SizeWidth ||
+                            !Owner.LayoutHeight.IsFixedValue || Owner.LayoutHeight != Owner.SizeHeight)
                         {
                             Owner.SetSize(right - left, bottom - top);
                             Owner.NotifyLayoutUpdated(false);