[NUI] Fix the crash when setting MinimumSize, MaximumSize (#1124)
authordongsug-song <35130733+dongsug-song@users.noreply.github.com>
Thu, 14 Nov 2019 23:58:38 +0000 (08:58 +0900)
committerGitHub <noreply@github.com>
Thu, 14 Nov 2019 23:58:38 +0000 (08:58 +0900)
src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs
src/Tizen.NUI/src/public/Extents.cs

index 80fa7c2..303eca7 100755 (executable)
@@ -1241,13 +1241,17 @@ namespace Tizen.NUI.BaseComponents
         /// MinimumSizeProperty
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public static readonly BindableProperty MinimumSizeProperty = BindableProperty.Create("MinimumSize", typeof(Size), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
+        public static readonly BindableProperty MinimumSizeProperty = BindableProperty.Create("MinimumSize", typeof(Size2D), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var view = (View)bindable;
-            Size temp = (Size)newValue;
+            Size2D temp = newValue as Size2D;
             if (temp != null)
             {
-                Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.MINIMUM_SIZE, new Tizen.NUI.PropertyValue(new Vector2(temp.Width, temp.Height)));
+                Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.MINIMUM_SIZE, new Tizen.NUI.PropertyValue(temp));
+            }
+            else
+            {
+                Tizen.Log.Fatal("NUI", $"[ERROR] can't set MinimumSizeProperty!");
             }
         },
         defaultValueCreator: (bindable) =>
@@ -1262,13 +1266,17 @@ namespace Tizen.NUI.BaseComponents
         /// MaximumSizeProperty
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public static readonly BindableProperty MaximumSizeProperty = BindableProperty.Create("MaximumSize", typeof(Size), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
+        public static readonly BindableProperty MaximumSizeProperty = BindableProperty.Create("MaximumSize", typeof(Size2D), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var view = (View)bindable;
-            Size temp = (Size)newValue;
+            Size2D temp = newValue as Size2D;
             if (temp != null)
             {
-                Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.MAXIMUM_SIZE, new Tizen.NUI.PropertyValue(new Vector2(temp.Width, temp.Height)));
+                Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.MAXIMUM_SIZE, new Tizen.NUI.PropertyValue(temp));
+            }
+            else
+            {
+                Tizen.Log.Fatal("NUI", $"[ERROR] can't set MaximumSizeProperty!");
             }
         },
         defaultValueCreator: (bindable) =>
index 27b77fe..7998ec4 100755 (executable)
@@ -106,7 +106,6 @@ namespace Tizen.NUI
         /// <summary>
         /// Constructor
         /// </summary>
-        /// <param name="cb"></param>
         /// <param name="start"></param>
         /// <param name="end"></param>
         /// <param name="top"></param>