[Kst] extragear/graphics/kst/kst

Andrew Walker arwalker at sumusltd.com
Tue Dec 20 01:53:34 CET 2005


SVN commit 489874 by arwalker:

as we are interested only in the size of the bounding rectangle, there is no need to worry about all the translations

 M  +2 -7      kstviewlabel.cpp  


--- trunk/extragear/graphics/kst/kst/kstviewlabel.cpp #489873:489874
@@ -438,7 +438,7 @@
   }
   
   QSize sz(_textWidth, _textHeight);
-  if (_rotation != 0 && _rotation != 180) {
+  if (int(_rotation) != 0 && int(_rotation) != 180) {
     QPointArray pts(4);
     pts[0] = QPoint(0, 0);
     pts[1] = QPoint(0, _textHeight);
@@ -447,14 +447,9 @@
     double theta = M_PI * (int(_rotation) % 360) / 180;
     double sina = sin(theta);
     double cosa = cos(theta);
-    QWMatrix m(cosa, sina, -sina, cosa, 0, 0);
+    QWMatrix m(cosa, sina, -sina, cosa, 0.0, 0.0);
 
-    QPoint to;
-    to.setX(_textWidth / 2);
-    to.setY(_textHeight / 2);
-    pts.translate(-to.x(), -to.y());
     pts = m.map(pts);
-    pts.translate(to.x(), to.y());
 
     if (_parent) {
       QRect r(position(), pts.boundingRect().size());


More information about the Kst mailing list