From 3ae512991913009f77ae48a47fd70304e30e8d2e Mon Sep 17 00:00:00 2001 From: Feng Jin Date: Wed, 19 Apr 2017 00:15:37 +0800 Subject: [PATCH] Improve the compatibility for the "destinationValue" parameter of AnimateTo and AnimateBy. Change-Id: Ibf2c81902788d1829c77cad7b7070851c95eb0c4 Signed-off-by: Feng Jin --- src/Tizen.NUI/src/public/Animation.cs | 44 +++++++++++++++++++++++++++++++++++ src/Tizen.NUI/src/public/Property.cs | 1 - 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/src/Tizen.NUI/src/public/Animation.cs b/src/Tizen.NUI/src/public/Animation.cs index 26e7e5d..2e7e182 100755 --- a/src/Tizen.NUI/src/public/Animation.cs +++ b/src/Tizen.NUI/src/public/Animation.cs @@ -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) diff --git a/src/Tizen.NUI/src/public/Property.cs b/src/Tizen.NUI/src/public/Property.cs index af5873c..e643178 100755 --- a/src/Tizen.NUI/src/public/Property.cs +++ b/src/Tizen.NUI/src/public/Property.cs @@ -1054,7 +1054,6 @@ namespace Tizen.NUI return value; } - /// /// Creates a Size2D property value. /// -- 2.7.4