From d48ecfbf1a19becc71aed94528b4af05ee8a384b Mon Sep 17 00:00:00 2001 From: neostom432 <31119276+neostom432@users.noreply.github.com> Date: Mon, 24 Feb 2020 15:25:17 +0900 Subject: [PATCH] Fix margin bug in FlexLayout (#1418) 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 | 4 ++-- src/Tizen.NUI/src/public/Layouting/FlexLayout.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Tizen.NUI/src/internal/Layouting/Interop/Interop.FlexLayout.cs b/src/Tizen.NUI/src/internal/Layouting/Interop/Interop.FlexLayout.cs index af7b8c0..9e71abb 100755 --- a/src/Tizen.NUI/src/internal/Layouting/Interop/Interop.FlexLayout.cs +++ b/src/Tizen.NUI/src/internal/Layouting/Interop/Interop.FlexLayout.cs @@ -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); diff --git a/src/Tizen.NUI/src/public/Layouting/FlexLayout.cs b/src/Tizen.NUI/src/public/Layouting/FlexLayout.cs index 1acbd86..5684f7f 100755 --- a/src/Tizen.NUI/src/public/Layouting/FlexLayout.cs +++ b/src/Tizen.NUI/src/public/Layouting/FlexLayout.cs @@ -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); } /// -- 2.7.4