Revert "[NUI] Apply Padding and Margin in AbsoluteLayout"
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Tue, 5 Oct 2021 02:39:33 +0000 (11:39 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 9 Nov 2021 05:57:53 +0000 (14:57 +0900)
This reverts commit 7006d62a55a69b5366b078bfbfcfbe3a346998ff.

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

index 9b5ff00..d6675df 100755 (executable)
@@ -52,14 +52,13 @@ namespace Tizen.NUI
                     continue;
                 }
 
-                MeasureChildWithMargins(childLayout, widthMeasureSpec, new LayoutLength(0), heightMeasureSpec, new LayoutLength(0));
+                // Get size of child with no padding, no margin. we won't support margin, padding for AbsolutLayout.
+                MeasureChildWithoutPadding(childLayout, widthMeasureSpec, heightMeasureSpec);
 
                 // Determine the width and height needed by the children using their given position and size.
                 // Children could overlap so find the right most child.
-                float childRight = childLayout.MeasuredWidth.Size.AsDecimal() + childLayout.Owner.PositionX +
-                                   Padding.Start + Padding.End + childLayout.Margin.Start + childLayout.Margin.End;
-                float childBottom = childLayout.MeasuredHeight.Size.AsDecimal() + childLayout.Owner.PositionY +
-                                    Padding.Top + Padding.Bottom + childLayout.Margin.Top + childLayout.Margin.Bottom;
+                float childRight = childLayout.MeasuredWidth.Size.AsDecimal() + childLayout.Owner.PositionX;
+                float childBottom = childLayout.MeasuredHeight.Size.AsDecimal() + childLayout.Owner.PositionY;
 
                 if (maxWidth < childRight)
                     maxWidth = childRight;
@@ -104,10 +103,10 @@ namespace Tizen.NUI
                 LayoutLength childWidth = childLayout.MeasuredWidth.Size;
                 LayoutLength childHeight = childLayout.MeasuredHeight.Size;
 
-                LayoutLength childLeft = new LayoutLength(childLayout.Owner.PositionX + Padding.Start + childLayout.Margin.Start);
-                LayoutLength childTop = new LayoutLength(childLayout.Owner.PositionY + Padding.Top + childLayout.Margin.Top);
+                LayoutLength childLeft = new LayoutLength(childLayout.Owner.PositionX);
+                LayoutLength childTop = new LayoutLength(childLayout.Owner.PositionY);
 
-                childLayout.Layout(childLeft, childTop, childLeft + childWidth, childTop + childHeight);
+                childLayout.Layout(childLeft, childTop, childLeft + childWidth, childTop + childHeight, true);
             }
         }
     }