[Kst] branches/work/kst/viewpaint/kst/kst

George Staikos staikos at kde.org
Sun Jan 29 23:53:22 CET 2006


SVN commit 503694 by staikos:

relative placement works on resize now, but it seems to drift a bit.


 M  +15 -1     kst2dplot.cpp  


--- branches/work/kst/viewpaint/kst/kst/kst2dplot.cpp #503693:503694
@@ -2164,8 +2164,21 @@
 
 
 void Kst2DPlot::resize(const QSize& size) {
+  // FIXME
+  // Horribly inefficient, but we need to update contentsRect() somehow
+  // before the base class resize happens.
+  _buffer.buffer().resize(size);
+  assert(!_buffer.buffer().isNull()); // Want to find these crashes
+  if (!_buffer.buffer().isNull()) {    // Because this is garbage
+    _buffer.buffer().fill(backgroundColor());
+    KstPainter p;
+    p.begin(&_buffer.buffer());
+    p.setWindow(0, 0, size.width(), size.height());
+    draw(p);
+    p.end();
+  }
   KstPlotBase::resize(size);
-  setDirty();
+  setDirty(false);
 }
 
 
@@ -2582,6 +2595,7 @@
   return QRect(left, top, dim, dim);
 }
 
+
 void Kst2DPlot::setPixRect(const QRect& RelPlotRegion, const QRect& RelWinRegion, const QRect& RelPlotAndAxisRegion) {
   PlotRegion = RelPlotRegion;
   PlotRegion.moveBy(geometry().x(), geometry().y());


More information about the Kst mailing list