From: minho.sun Date: Tue, 1 Aug 2017 01:20:50 +0000 (+0900) Subject: Revert "[Tizen] Add value check to color." X-Git-Tag: preview1-00180^2~130 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=00bc1de8aa4471f071b96cb389e813383413cea9;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Revert "[Tizen] Add value check to color." This reverts commit 70e8ccb9b51ea8d7a3e460acbef3bebfa27cf827. Change-Id: I37fada07d464ddd9b1368d38665a72c255847e1e --- diff --git a/src/Tizen.NUI/src/public/Color.cs b/src/Tizen.NUI/src/public/Color.cs index 1d3d55c..5a72491 100755 --- a/src/Tizen.NUI/src/public/Color.cs +++ b/src/Tizen.NUI/src/public/Color.cs @@ -114,9 +114,7 @@ namespace Tizen.NUI /// A Color containing the result of the addition public static Color operator +(Color arg1, Color arg2) { - Color result = arg1.Add(arg2); - ValueCheck(result); - return result; + return arg1.Add(arg2); } /// @@ -127,9 +125,7 @@ namespace Tizen.NUI /// A Color containing the result of the subtraction public static Color operator -(Color arg1, Color arg2) { - Color result = arg1.Subtract(arg2); - ValueCheck(result); - return result; + return arg1.Subtract(arg2); } /// @@ -139,9 +135,7 @@ namespace Tizen.NUI /// A Color containg the negation public static Color operator -(Color arg1) { - Color result = arg1.Subtract(); - ValueCheck(result); - return result; + return arg1.Subtract(); } /// @@ -152,16 +146,12 @@ namespace Tizen.NUI /// A Color containing the result of the multiplication public static Color operator *(Color arg1, Color arg2) { - Color result = arg1.Multiply(arg2); - ValueCheck(result); - return result; + return arg1.Multiply(arg2); } public static Color operator*(Color arg1, float arg2) { - Color result = arg1.Multiply(arg2); - ValueCheck(result); - return result; + return arg1.Multiply(arg2); } /// @@ -172,16 +162,12 @@ namespace Tizen.NUI /// A Color containing the result of the division public static Color operator /(Color arg1, Color arg2) { - Color result = arg1.Divide(arg2); - ValueCheck(result); - return result; + return arg1.Divide(arg2); } public static Color operator/(Color arg1, float arg2) { - Color result = arg1.Divide(arg2); - ValueCheck(result); - return result; + return arg1.Divide(arg2); } /// @@ -222,10 +208,6 @@ namespace Tizen.NUI /// alpha component public Color(float r, float g, float b, float a) : this(NDalicPINVOKE.new_Vector4__SWIG_1(r, g, b, a), true) { - ValueCheck(ref r); - ValueCheck(ref g); - ValueCheck(ref b); - ValueCheck(ref a); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -235,10 +217,6 @@ namespace Tizen.NUI /// array Array of R,G,B,A public Color(float[] array) : this(NDalicPINVOKE.new_Vector4__SWIG_2(array), true) { - ValueCheck(ref array[0]); - ValueCheck(ref array[1]); - ValueCheck(ref array[2]); - ValueCheck(ref array[3]); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -375,7 +353,6 @@ namespace Tizen.NUI { set { - ValueCheck(ref value); NDalicPINVOKE.Vector4_r_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -394,7 +371,6 @@ namespace Tizen.NUI { set { - ValueCheck(ref value); NDalicPINVOKE.Vector4_g_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -413,7 +389,6 @@ namespace Tizen.NUI { set { - ValueCheck(ref value); NDalicPINVOKE.Vector4_b_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -432,7 +407,6 @@ namespace Tizen.NUI { set { - ValueCheck(ref value); NDalicPINVOKE.Vector4_a_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -507,64 +481,6 @@ namespace Tizen.NUI return new Color(vec.R, vec.G, vec.B, vec.A); } - internal static void ValueCheck(Color color) - { - if (color.R < 0.0f) - { - color.R = 0.0f; - Tizen.Log.Fatal("NUI", "The value of Result is invalid! Should be between [0, 1]."); - } - else if (color.R > 1.0f) - { - color.R = 1.0f; - Tizen.Log.Fatal("NUI", "The value of Result is invalid! Should be between [0, 1]."); - } - if (color.G < 0.0f) - { - color.G = 0.0f; - Tizen.Log.Fatal("NUI", "The value of Result is invalid! Should be between [0, 1]."); - } - else if (color.G > 1.0f) - { - color.G = 1.0f; - Tizen.Log.Fatal("NUI", "The value of Result is invalid! Should be between [0, 1]."); - } - if (color.B < 0.0f) - { - color.B = 0.0f; - Tizen.Log.Fatal("NUI", "The value of Result is invalid! Should be between [0, 1]."); - } - else if (color.B > 1.0f) - { - color.B = 1.0f; - Tizen.Log.Fatal("NUI", "The value of Result is invalid! Should be between [0, 1]."); - } - if (color.A < 0.0f) - { - color.A = 0.0f; - Tizen.Log.Fatal("NUI", "The value of Result is invalid! Should be between [0, 1]."); - } - else if (color.A > 1.0f) - { - color.A = 1.0f; - Tizen.Log.Fatal("NUI", "The value of Result is invalid! Should be between [0, 1]."); - } - } - - internal static void ValueCheck(ref float value) - { - if (value < 0.0f) - { - value = 0.0f; - Tizen.Log.Fatal("NUI", "The value of Parameters is invalid! Should be between [0, 1]."); - } - else if (value > 1.0f) - { - value = 1.0f; - Tizen.Log.Fatal("NUI", "The value of Parameters is invalid! Should be between [0, 1]."); - } - } - } }