[NUI] Fix text label layout
authorBowon Ryu <bowon.ryu@samsung.com>
Mon, 9 Jun 2025 12:26:21 +0000 (21:26 +0900)
committerJaehyun Cho <jaehyun0cho@gmail.com>
Thu, 12 Jun 2025 07:37:40 +0000 (16:37 +0900)
Bug fix when the width and height specification of the text label is wrap, wrap.
I think even if the width is wrap, it should not exceed the size of the parent.
But I can not predict what compatibility this will break.

Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs

index 8db0644856e7462c4cbb721f6cbc0e2e63ae62f3..dd7aacf21491a397e9997336c5060ddba08d6d34 100755 (executable)
@@ -65,7 +65,9 @@ namespace Tizen.NUI.BaseComponents
                     }
                     else
                     {
-                        float width = naturalSize != null ? naturalSize.Width : 0;
+                        float width = naturalSize?.Width ?? 0;
+                        width = Math.Min(width, totalWidth);
+
                         // Since priority of MinimumSize is higher than MaximumSize in DALi, here follows it.
                         totalWidth = Math.Min(Math.Max(width, minSize.Width), (maxSize.Width < 0 ? Int32.MaxValue : maxSize.Width));