Bug 130282 - Start and end arrow scalings are mixed
Summary: Start and end arrow scalings are mixed
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: unspecified Solaris
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-05 10:02 UTC by Nicolas Brisset
Modified: 2006-07-05 20:14 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Brisset 2006-07-05 10:02:17 UTC
Version:           1.3.0_devel (using KDE 3.4.0, compiled sources)
Compiler:          gcc version 3.4.3
OS:                SunOS (sun4u) release 5.8

Now that I've started, I'll continue with the "small glitches with view objects series". I don't know whether these are fixed in Duncan's branch. If not, they should be handled (especially as I believe they are easy to fix).

In the arrow object dialog, there are two scaling spinboxes, but it seems that only the end arrow scaling one is active and applies to both heads.
Comment 1 Andrew Walker 2006-07-05 20:14:02 UTC
SVN commit 558623 by arwalker:

BUG:130282 Correctly scale start and end of arrow

 M  +4 -4      kstviewarrow.cpp  
 M  +1 -1      kstviewarrow.h  


--- trunk/extragear/graphics/kst/src/libkstapp/kstviewarrow.cpp #558622:558623
@@ -86,8 +86,8 @@
 }
 
 
-void KstViewArrow::paintArrow(KstPainter& p, const QPoint& to, const QPoint &from, int w) {
-  double deltax = _toArrowScaling * 2.0 * double(w);
+void KstViewArrow::paintArrow(KstPainter& p, const QPoint& to, const QPoint &from, int w, double scaling) {
+  double deltax = scaling * 2.0 * double(w);
   double theta = atan2(double(from.y() - to.y()), double(from.x() - to.x())) - M_PI / 2.0;
   double sina = sin(theta);
   double cosa = cos(theta);
@@ -163,10 +163,10 @@
     p.setBrush(_foregroundColor);
     
     if (_hasToArrow) {      
-      paintArrow(p, to, from, w);
+      paintArrow(p, to, from, w, _toArrowScaling);
     }
     if (_hasFromArrow) {      
-      paintArrow(p, from, to, w);
+      paintArrow(p, from, to, w, _fromArrowScaling);
     }
   }
   p.restore();
--- trunk/extragear/graphics/kst/src/libkstapp/kstviewarrow.h #558622:558623
@@ -42,7 +42,7 @@
     virtual KstViewObject* copyObjectQuietly(KstViewObject& parent, const QString& name = QString::null) const;
 
     void paintSelf(KstPainter& p, const QRegion& bounds);
-    void paintArrow(KstPainter& p, const QPoint& to, const QPoint &from, int w);
+    void paintArrow(KstPainter& p, const QPoint& to, const QPoint &from, int w, double scaling);
     // true if either end has an arrow 
     bool hasArrow() const;