Improve the compatibility for the "destinationValue" parameter of AnimateTo and...
authorFeng Jin <feng16.jin@samsung.com>
Tue, 18 Apr 2017 16:15:37 +0000 (00:15 +0800)
committerFeng Jin <feng16.jin@samsung.com>
Fri, 21 Apr 2017 15:11:29 +0000 (23:11 +0800)
Change-Id: Ibf2c81902788d1829c77cad7b7070851c95eb0c4
Signed-off-by: Feng Jin <feng16.jin@samsung.com>
src/Tizen.NUI/src/public/Animation.cs
src/Tizen.NUI/src/public/Property.cs

index 26e7e5d..2e7e182 100755 (executable)
@@ -386,6 +386,17 @@ namespace Tizen.NUI
                 throw new System.Exception("second argument string property is invalid parameter!");
             }
 
+            PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
+            if(propertyType.Equals(PropertyType.Float))
+            {
+                System.Type type = relativeValue.GetType();
+                if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
+                {
+                    int num = (int)relativeValue;
+                    relativeValue = (float)num;
+                }
+            }
+
             PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
 
             if (alphaFunction != null)
@@ -419,6 +430,17 @@ namespace Tizen.NUI
                 throw new System.Exception("second argument string property is invalid parameter!");
             }
 
+            PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
+            if(propertyType.Equals(PropertyType.Float))
+            {
+                System.Type type = relativeValue.GetType();
+                if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
+                {
+                    int num = (int)relativeValue;
+                    relativeValue = (float)num;
+                }
+            }
+
             PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
 
             if (alphaFunction != null)
@@ -452,6 +474,17 @@ namespace Tizen.NUI
                 throw new System.Exception("second argument string property is invalid parameter!");
             }
 
+            PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
+            if(propertyType.Equals(PropertyType.Float))
+            {
+                System.Type type = destinationValue.GetType();
+                if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
+                {
+                    int num = (int)destinationValue;
+                    destinationValue = (float)num;
+                }
+            }
+
             PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
 
             if (alphaFunction != null)
@@ -486,6 +519,17 @@ namespace Tizen.NUI
                 throw new System.Exception("second argument string property is invalid parameter!");
             }
 
+            PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
+            if(propertyType.Equals(PropertyType.Float))
+            {
+                System.Type type = destinationValue.GetType();
+                if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
+                {
+                    int num = (int)destinationValue;
+                    destinationValue = (float)num;
+                }
+            }
+
             PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
 
             if (alphaFunction != null)
index af5873c..e643178 100755 (executable)
@@ -1054,7 +1054,6 @@ namespace Tizen.NUI
             return value;
         }
 
-
         /// <summary>
         /// Creates a Size2D property value.
         /// </summary>