[Kst] kdeextragear-2/kst/kst

Andrew Walker arwalker at sumusltd.com
Tue Dec 14 00:07:00 CET 2004


CVS commit by arwalker: 

Correctly setup the clip region for printing.


  M +9 -9      kst2dplot.cpp   1.318


--- kdeextragear-2/kst/kst/kst2dplot.cpp  #1.317:1.318
@@ -5061,5 +5061,5 @@ void Kst2DPlot::plotCurves(QPainter& p,
   clipRegion = p.clipRegion();
   clipping = p.hasClipping();
-  p.setClipRegion(QRegion(int(Lx), int(Ly), int(Hx-Lx), int(Hy-Ly), QRegion::Rectangle));
+  p.setClipRect((int)Lx, (int)Ly, (int)(Hx-Lx), (int)(Hy-Ly), QPainter::CoordPainter);
 
   for (int i_curve = 0; i_curve < (int)Curves.count(); i_curve++) {
@@ -5471,13 +5471,13 @@ void Kst2DPlot::plotCurves(QPainter& p,
       if (c->hasPoints()) {
         if (c->hasLines() && c->pointDensity() != 0) {
-          QRegion rgn(GetPlotRegion(), QRegion::Rectangle);
+          QRegion rgn((int)Lx, (int)Ly, (int)(Hx-Lx), (int)(Hy-Ly), QRegion::Rectangle);
           QPoint  point;
           int     size;
 
           size = (int)pow(3.0, KSTPOINTDENSITY_MAXTYPE - c->pointDensity());
-          if (GetPlotRegion().width() > GetPlotRegion().height()) {
-            size = GetPlotRegion().width() / size;
+          if (Hx-Lx > Hy-Ly) {
+            size = (int)(Hx-Lx) / size;
           } else {
-            size = GetPlotRegion().height() / size;
+            size = (int)(Hy-Ly) / size;
           }
           for (i_pt = i0; i_pt <= iN; i_pt++) {
@@ -5490,9 +5490,9 @@ void Kst2DPlot::plotCurves(QPainter& p,
             }
 
-            point.setX(d2i(m_X * rX + b_X));
-            point.setY(d2i(m_Y * rY + b_Y));
+            point.setX( d2i(m_X * rX + b_X) );
+            point.setY( d2i(m_Y * rY + b_Y) );
             if (rgn.contains(point)) {
               c->Point.draw(&p, point.x(), point.y(), c->lineWidth());
-              rgn -= QRegion(point.x()-size/2, point.y()-size/2, size, size, QRegion::Ellipse);
+              rgn -= QRegion(point.x()-(size/2), point.y()-(size/2), size, size, QRegion::Ellipse);
             }
           }





More information about the Kst mailing list