[Kst] [Bug 118363] Arrows only go to the right

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


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=118363         
arwalker sumusltd com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From arwalker sumusltd com  2005-12-16 20:42 -------
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