[Kst] extragear/graphics/kst/src/libkstapp

Andrew Walker arwalker at sumusltd.com
Wed Jul 5 20:13:39 CEST 2006


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;
     


More information about the Kst mailing list