[Kst] extragear/graphics/kst/kst

Rick Chern rchern at interchange.ubc.ca
Fri Aug 5 02:56:13 CEST 2005


SVN commit 443133 by rchern:

Draw ellipses from centre

 M  +4 -4      kstgfxellipsemousehandler.cpp  


--- trunk/extragear/graphics/kst/kst/kstgfxellipsemousehandler.cpp #443132:443133
@@ -45,17 +45,17 @@
   // set its corner point appropriately
   QPoint newTopLeft;
   if (_mouseOrigin.x() < pos.x()) {
-    newTopLeft.setX(_mouseOrigin.x());
+    newTopLeft.setX(2*_mouseOrigin.x() - pos.x());
   } else {
     newTopLeft.setX(pos.x());
   }
   if (_mouseOrigin.y() < pos.y()) {
-    newTopLeft.setY(_mouseOrigin.y());
+    newTopLeft.setY(2*_mouseOrigin.y() - pos.y());
   } else {
     newTopLeft.setY(pos.y());  
   }
-  QSize newSize(abs(pos.x() - _mouseOrigin.x()),
-                abs(pos.y() - _mouseOrigin.y()));
+  QSize newSize(2*abs(pos.x() - _mouseOrigin.x()),
+                2*abs(pos.y() - _mouseOrigin.y()));
   
   // do the move and resize
   _drawingEllipse->move(newTopLeft);


More information about the Kst mailing list