[NUI] Fix ScrollableBase Layout to respect MaximumSize
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Thu, 17 Apr 2025 08:44:44 +0000 (17:44 +0900)
committerJiyun Yang <ji.yang@samsung.com>
Wed, 23 Apr 2025 05:51:52 +0000 (14:51 +0900)
Previously, ScrollableBase Layout did not respect MaximumSize so the
Size property value might be bigger than actual rendered size on screen
if MaximumSize is smaller than Size property value.
Because actual rendered size respects MaximumSize in DALi.

Now, ScrollableBase Layout respects MaximumSize so the Size property
value and actual rendered size on screen are the same.

src/Tizen.NUI.Components/Controls/ScrollableBase.cs

index 179fd3c3f24a7e3e7dfbe4725be740af49c55793..a4329e0dbbbf1cdbd15697b2c7a6bf734589a6cf 100755 (executable)
@@ -216,6 +216,10 @@ namespace Tizen.NUI.Components
                 totalWidth = Math.Max(totalWidth, SuggestedMinimumWidth.AsDecimal());
                 totalHeight = Math.Max(totalHeight, SuggestedMinimumHeight.AsDecimal());
 
+                // Since priority of MinimumSize is higher than MaximumSize in DALi, here follows it.
+                totalWidth = Math.Max(Math.Min(totalWidth, Owner.GetMaximumWidth()), Owner.GetMinimumWidth());
+                totalHeight = Math.Max(Math.Min(totalHeight, Owner.GetMaximumHeight()), Owner.GetMinimumHeight());
+
                 widthSizeAndState.State = childWidthState;
                 heightSizeAndState.State = childHeightState;