Bug 118363 - Arrows only go to the right
Summary: Arrows only go to the right
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-15 05:38 UTC by Matthew Truch
Modified: 2005-12-16 20:42 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Truch 2005-12-15 05:38:01 UTC
Version:           svn_trunk (using KDE KDE 3.4.2)
Installed from:    Fedora RPMs
OS:                Linux

It is impossible to draw an arrow that points to the left.
Comment 1 George Staikos 2005-12-15 05:48:39 UTC
On Wednesday 14 December 2005 23:38, Matthew Truch wrote:
> It is impossible to draw an arrow that points to the left.


  Known issue, but not entirely true.  In fixing the mouse handling I had to 
break this.  It's possible to rotate the arrow after it's drawn and given 
that we have so many other issues to solve for 1.2, I think we'll leave this 
for 1.2.1.
Comment 2 Andrew Walker 2005-12-16 20:42:13 UTC
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;
 }