[NUI] Fix WidthSpecification and HeightSpecification not to set Size2D
authorEunki, Hong <eunkiki.hong@samsung.com>
Fri, 9 Dec 2022 04:29:48 +0000 (13:29 +0900)
committerJoogabYun <40262755+JoogabYun@users.noreply.github.com>
Wed, 14 Dec 2022 02:16:18 +0000 (11:16 +0900)
We don't need to change the width value when we try to set the height.
Also, widthPolicy might not matched with SizeWidth when we use NUI.Animation

Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
src/Tizen.NUI/src/public/BaseComponents/View.cs
src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs

index 30c584d..817c3f0 100755 (executable)
@@ -2605,11 +2605,7 @@ namespace Tizen.NUI.BaseComponents
                 widthPolicy = value;
                 if (widthPolicy >= 0)
                 {
-                    if (heightPolicy >= 0) // Policy an exact value
-                    {
-                        // Create Size2D only both _widthPolicy and _heightPolicy are set.
-                        Size2D = new Size2D(widthPolicy, heightPolicy);
-                    }
+                    SizeWidth = widthPolicy;
                 }
                 layout?.RequestLayout();
             }
@@ -2662,11 +2658,7 @@ namespace Tizen.NUI.BaseComponents
                 heightPolicy = value;
                 if (heightPolicy >= 0)
                 {
-                    if (widthPolicy >= 0) // Policy an exact value
-                    {
-                        // Create Size2D only both _widthPolicy and _heightPolicy are set.
-                        Size2D = new Size2D(widthPolicy, heightPolicy);
-                    }
+                    SizeHeight = heightPolicy;
                 }
                 layout?.RequestLayout();
             }
index ae97b90..a10622c 100755 (executable)
@@ -733,12 +733,6 @@ namespace Tizen.NUI.BaseComponents
                 }
                 Object.InternalRetrievingPropertyVector2ActualVector3(view.SwigCPtr, View.Property.SIZE, view.internalSize2D.SwigCPtr);
 
-                // Update NUI stored internal size informations only both widthPolicy and heightPolicy are fixed.
-                if(view.widthPolicy >= 0 && view.heightPolicy >= 0)
-                {
-                    view.widthPolicy = view.internalSize2D.Width;
-                    view.heightPolicy = view.internalSize2D.Height;
-                }
                 return view.internalSize2D;
             }
         );
@@ -1580,12 +1574,6 @@ namespace Tizen.NUI.BaseComponents
                 }
                 Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.SIZE, view.internalSize.SwigCPtr);
 
-                // Update NUI stored internal size informations only both widthPolicy and heightPolicy are fixed.
-                if(view.WidthSpecification >= 0 && view.HeightSpecification >= 0)
-                {
-                    view.WidthSpecification = (int)System.Math.Ceiling(view.internalSize.Width);
-                    view.HeightSpecification = (int)System.Math.Ceiling(view.internalSize.Height);
-                }
                 return view.internalSize;
             }
         );