[Kst] extragear/graphics/kst/kst
Barth Netterfield
netterfield at astro.utoronto.ca
Wed Sep 21 13:37:48 CEST 2005
SVN commit 462564 by netterfield:
Introduce KstPaintType P_UPDATE, which means that at least one
curve has been updated.
If any curves are updated, then redraw all kstviewlabels.
M +1 -1 kstdoc.cpp
M +5 -7 kstviewlabel.cpp
M +2 -1 kstviewobject.h
--- trunk/extragear/graphics/kst/kst/kstdoc.cpp #462563:462564
@@ -961,7 +961,7 @@
}
KstApp::inst()->deleteIterator(it);
}
- KstApp::inst()->paintAll();
+ KstApp::inst()->paintAll(P_UPDATE);
}
break;
case ThreadEvent::UpdateAllDialogs:
--- trunk/extragear/graphics/kst/kst/kstviewlabel.cpp #462563:462564
@@ -154,7 +154,6 @@
void KstViewLabel::resize(const QSize& size) {
KstBorderedViewObject::resize(size);
- kdDebug() << "resize\n";
drawToBuffer(_parsed);
}
@@ -293,7 +292,7 @@
void KstViewLabel::paint(KstPaintType type, QPainter& p) {
- kdDebug() << type << ": paint viewlabel\n";
+
if (type == P_PRINT) {
p.save();
if (_autoResize) {
@@ -307,6 +306,9 @@
//setDirty();
p.restore();
} else {
+ if (type == P_UPDATE) {
+ setDirty();
+ }
bool d = dirty();
if (d) {
if (_autoResize) {
@@ -336,12 +338,9 @@
}
if (_clipMask.isNull()) {
- kdDebug() << "--- setting clipmask\n";
QBitmap bm = _backBuffer.buffer().createHeuristicMask(false); // slow but preserves antialiasing...
_clipMask = QRegion(bm);
_clipMask.translate(geometry().topLeft().x(), geometry().topLeft().y());
- } else {
- kdDebug() << "--- not setting clipmask\n";
}
return _clipMask;
@@ -471,8 +470,7 @@
void KstViewLabel::writeBinary(QDataStream& str) {
KstBorderedViewObject::writeBinary(str);
str << _rotation << _txt << _symbolFontName << _fontName
- << _replace << _interpret << _justify
- ;
+ << _replace << _interpret << _justify;
}
--- trunk/extragear/graphics/kst/kst/kstviewobject.h #462563:462564
@@ -42,10 +42,11 @@
// KstPaintType - hints to paint to allow optimizations
// P_PAINT: Neither 'data' nor 'plot' needs to change
// P_PLOT: data didn't change
+// P_UPDATE: at least one curve was updated
/* FIXME: Define P_PLOT better, and do we even need P_ZOOM, P_PLOT and P_PAINT?
They should all do the same thing.
*/
-enum KstPaintType { P_PAINT, P_PLOT, P_ZOOM, P_PRINT, P_EXPORT };
+enum KstPaintType { P_PAINT, P_PLOT, P_ZOOM, P_UPDATE, P_PRINT, P_EXPORT };
struct KstAspectRatio {
KstAspectRatio() : x(0.0), y(0.0), w(0.0), h(0.0) {}
More information about the Kst
mailing list