Merge "(C#) Changed Rectangle to have float properties" into devel/master
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Wed, 29 Mar 2017 17:05:03 +0000 (10:05 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Wed, 29 Mar 2017 17:05:03 +0000 (10:05 -0700)
plugins/dali-swig/SWIG/events/rectangle.i
plugins/dali-swig/examples/dali-test.cs

index b9e9c95..0d7f7b7 100644 (file)
 
 %define DALI_RECTANGLE_PROPERTY_PARAM(NameSpace,ClassName)
   %typemap(cscode) NameSpace::ClassName %{
+    public Rectangle(float x, float y, float width, float height) : this( (int)x, (int)y, (int)width, (int)height )
+    {
+    }
+
     public static bool operator ==(Rectangle a, Rectangle b)
     {
         // If both are null, or both are same instance, return true.
         return !(a == b);
     }
 
-    ///< X position of the rectangle
-    public int X
+    ///< X position of the rectangle, values after the decimal point are ignored, float type provided for convenience.
+    public float X
     {
         set
         {
-            x = value;
+            x = (int)( value );
         }
         get
         {
         }
     }
 
-    ///< Y position of the rectangle
-    public int Y
+    ///< Y position of the rectangle, values after the decimal point are ignored, float type provided for convenience.
+    public float Y
     {
         set
         {
-            y = value;
+            y = (int)( value );
         }
         get
         {
         }
     }
 
-    ///< Width of the rectangle
-    public int Width
+    ///< Width of the rectangle, values after the decimal point are ignored, float type provided for convenience.
+    public float Width
     {
         set
         {
-            width = value;
+            width = (int)( value );
         }
         get
         {
         }
     }
 
-    ///< Height of the rectangle
-    public int Height
+    ///< Height of the rectangle, values after the decimal point are ignored, float type provided for convenience.
+    public float Height
     {
         set
         {
-            height = value;
+            height = (int)( value );
         }
         get
         {
index 2dbe547..a4a3a1e 100755 (executable)
@@ -206,7 +206,7 @@ namespace MyCSharpExample
 
             Console.WriteLine( " *************************" );
 
-            using (Rectangle r2 = new Rectangle(2, 5, 20, 30))
+            using (Rectangle r2 = new Rectangle(2, 5, 20.0f, 30.0f))
             {
                 Console.WriteLine( "    Created " + r2 );
                 r2.Set(1,1,40,40);