[Kst] extragear/graphics/kst/kst

Andrew Walker arwalker at sumusltd.com
Fri Dec 16 20:42:10 CET 2005


SVN commit 489017 by arwalker:

BUG:118363 Allow arrows to be created in any orientation

 M  +13 -5     kstgfxmousehandlerutils.cpp  


--- trunk/extragear/graphics/kst/kst/kstgfxmousehandlerutils.cpp #489016:489017
@@ -73,13 +73,21 @@
       }
     }
   }
-  bool topLeft = (mouseOrigin.x() <= fakePos.x() && mouseOrigin.y() <= fakePos.y()) || (mouseOrigin.x() >= fakePos.x() && mouseOrigin.y() >= fakePos.y());
+    
   QRect lineRect(mouseOrigin, fakePos);
-  QRect reduced = lineRect.normalize().intersect(boundingBox);
-  if (topLeft) {
-    return reduced;
+  QRect reduced = lineRect.normalize().intersect(boundingBox);  
+  
+  lineRect = reduced;
+  if (mouseOrigin.x() > fakePos.x()) {
+    lineRect.setLeft(reduced.right());
+    lineRect.setRight(reduced.left());
   }
-  return QRect(reduced.bottomLeft(), reduced.topRight());
+  if (mouseOrigin.y() > fakePos.y()) {
+    lineRect.setTop(reduced.bottom());
+    lineRect.setBottom(reduced.top());    
+  }
+  
+  return lineRect;
 }
 
 


More information about the Kst mailing list