Fix margin bug in FlexLayout (#1418)
authorneostom432 <31119276+neostom432@users.noreply.github.com>
Mon, 24 Feb 2020 06:25:17 +0000 (15:25 +0900)
committerGitHub <noreply@github.com>
Mon, 24 Feb 2020 06:25:17 +0000 (15:25 +0900)
Previously, margin of chilren in FlexLayout was ignored because it was not set to FlexNode of children.
Now, when adding child to View which using FlexLayout, we pass margin of child and set it to FlexNode of child.

src/Tizen.NUI/src/internal/Layouting/Interop/Interop.FlexLayout.cs
src/Tizen.NUI/src/public/Layouting/FlexLayout.cs

index af7b8c0..9e71abb 100755 (executable)
@@ -17,8 +17,8 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_SetMeasureFunction")]
             public static extern global::System.IntPtr FlexLayout_SetMeasureFunction( global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
 
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_AddChild")]
-            public static extern void FlexLayout_AddChild( global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, Tizen.NUI.FlexLayout.ChildMeasureCallback jarg3, int jarg4);
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_AddChildWithMargin")]
+            public static extern void FlexLayout_AddChildWithMargin( global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, Tizen.NUI.FlexLayout.ChildMeasureCallback jarg4, int jarg5);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_RemoveChild")]
             public static extern global::System.IntPtr FlexLayout_RemoveChild( global::System.Runtime.InteropServices.HandleRef jarg1, LayoutItem jarg2);
index 1acbd86..5684f7f 100755 (executable)
@@ -424,7 +424,7 @@ namespace Tizen.NUI
         void InsertChild( LayoutItem child )
         {
             // Store created node for child
-            Interop.FlexLayout.FlexLayout_AddChild(swigCPtr, View.getCPtr(child.Owner), measureChildDelegate, LayoutChildren.Count-1);
+            Interop.FlexLayout.FlexLayout_AddChildWithMargin(swigCPtr, View.getCPtr(child.Owner), Extents.getCPtr(child.Owner.Margin), measureChildDelegate, LayoutChildren.Count-1);
         }
 
         /// <summary>