Author: alanmc
Date: 2007-07-20 12:15:07 -0400 (Fri, 20 Jul 2007)
New Revision: 82365

Modified:
   trunk/lunareclipse/ChangeLog
   trunk/lunareclipse/Model/Draw/SelectionDraw.cs
Log:
* Model/Draw/SelectionDraw.cs: Cosmetic

Modified: trunk/lunareclipse/ChangeLog
===================================================================
--- trunk/lunareclipse/ChangeLog        2007-07-20 16:07:44 UTC (rev 82364)
+++ trunk/lunareclipse/ChangeLog        2007-07-20 16:15:07 UTC (rev 82365)
@@ -1,5 +1,9 @@
 2007-07-20  Alan McGovern <[EMAIL PROTECTED]> 
 
+       * Model/Draw/SelectionDraw.cs: Cosmetic
+
+2007-07-20  Alan McGovern <[EMAIL PROTECTED]> 
+
        Added a comment explaining the need for the crazy math
 
 2007-07-20  Alan McGovern <[EMAIL PROTECTED]> 

Modified: trunk/lunareclipse/Model/Draw/SelectionDraw.cs
===================================================================
--- trunk/lunareclipse/Model/Draw/SelectionDraw.cs      2007-07-20 16:07:44 UTC 
(rev 82364)
+++ trunk/lunareclipse/Model/Draw/SelectionDraw.cs      2007-07-20 16:15:07 UTC 
(rev 82365)
@@ -371,23 +371,17 @@
                        
                        // When resizing shapes, we need to do some crazy maths 
to make sure
                        // that when we resize, the shape doesn't 'float' 
around the canvas.
-                       if(b.Handle == b.WidthHandle1)
+                       if(b.Handle == b.WidthHandle1 && (oldWidth + offset.X) 
>= 0)
             {
-                if((oldWidth + offset.X) >= 0)
-                {
-                                       
b.Child.SetValue<double>(Canvas.WidthProperty, oldWidth + offset.X);
-                                       
b.Child.SetValue<double>(Canvas.LeftProperty, oldLeft  - offset.X * (1 - 
cosAngle) / 2);
-                    b.Child.SetValue<double>(Canvas.TopProperty, oldTop + 
offset.X * sinAngle / 2.0);
-                }
+                               b.Child.SetValue<double>(Canvas.WidthProperty, 
oldWidth + offset.X);
+                               b.Child.SetValue<double>(Canvas.LeftProperty, 
oldLeft  - offset.X * (1 - cosAngle) / 2);
+                               b.Child.SetValue<double>(Canvas.TopProperty, 
oldTop + offset.X * sinAngle / 2.0);
             }
-                       else if(b.Handle == b.WidthHandle2)
+                       else if(b.Handle == b.WidthHandle2 && (oldWidth - 
offset.X) >= 0)
                        {
-                if((oldWidth - offset.X) >= 0)
-                               {
-                                       
b.Child.SetValue<double>(Canvas.WidthProperty, oldWidth - offset.X);
-                                       
b.Child.SetValue<double>(Canvas.LeftProperty, oldLeft + offset.X * cosAngle + 
offset.X * (1 - cosAngle) / 2);
-                                       
b.Child.SetValue<double>(Canvas.TopProperty, oldTop + offset.X / 2.0 * 
sinAngle);
-                }
+                               b.Child.SetValue<double>(Canvas.WidthProperty, 
oldWidth - offset.X);
+                               b.Child.SetValue<double>(Canvas.LeftProperty, 
oldLeft + offset.X * cosAngle + offset.X * (1 - cosAngle) / 2);
+                               b.Child.SetValue<double>(Canvas.TopProperty, 
oldTop + offset.X / 2.0 * sinAngle);
             }
 
                        // Change the height

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to