[NUI] Fix ScrollableBase to propagate measuring with unlimited constraints
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Tue, 10 Jun 2025 01:41:10 +0000 (10:41 +0900)
committerJaehyun Cho <jaehyun0cho@gmail.com>
Thu, 12 Jun 2025 07:37:40 +0000 (16:37 +0900)
Up to now, ScrollableBase measures with Unspecified option and its
limited constraints.
e.g. Unspecified option with (1920, 1080) constraints

This causes that its grand children are not measured with unlimited
constraints.
e.g. ScrollableBase - CustomLinearLayout - LinearLayout - TextLabel
     LinearLayout is measured with unlimited constraints.
     TextLabel is measured with limited constraints.

To propagate measuring descendants with unlimited constraints,
ScrollableBase is fixed to measure with AtMost option and unlimited
constraints.
e.g. AtMost option with int.MaxValue constraints

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

index d7f18d49fbf85eaf21d0fbc60ad97479f31ef6eb..f59255db48b1da9555baf7599e4b5340d1daec78 100755 (executable)
@@ -183,12 +183,12 @@ namespace Tizen.NUI.Components
                         // or Width for horizontal scrolling
                         if (scrollingDirection == Direction.Vertical)
                         {
-                            MeasureSpecification unrestrictedMeasureSpec = new MeasureSpecification(heightMeasureSpec.Size, MeasureSpecification.ModeType.Unspecified);
+                            MeasureSpecification unrestrictedMeasureSpec = new MeasureSpecification(new LayoutLength(int.MaxValue), MeasureSpecification.ModeType.AtMost);
                             MeasureChildWithMargins(childLayout, widthMeasureSpec, new LayoutLength(0), unrestrictedMeasureSpec, new LayoutLength(0)); // Height unrestricted by parent
                         }
                         else
                         {
-                            MeasureSpecification unrestrictedMeasureSpec = new MeasureSpecification(widthMeasureSpec.Size, MeasureSpecification.ModeType.Unspecified);
+                            MeasureSpecification unrestrictedMeasureSpec = new MeasureSpecification(new LayoutLength(int.MaxValue), MeasureSpecification.ModeType.AtMost);
                             MeasureChildWithMargins(childLayout, unrestrictedMeasureSpec, new LayoutLength(0), heightMeasureSpec, new LayoutLength(0)); // Width unrestricted by parent
                         }