[Kst] extragear/graphics/kst/kst
George Staikos
staikos at kde.org
Tue Dec 20 06:33:14 CET 2005
SVN commit 489910 by staikos:
apply the same fixes to ellipse and box that were applied to picture
M +11 -6 kstviewbox.cpp
M +9 -8 kstviewellipse.cpp
M +0 -1 kstviewobject.cpp
--- trunk/extragear/graphics/kst/kst/kstviewbox.cpp #489909:489910
@@ -68,16 +68,21 @@
}
+// FIXME: this object is trying to paint its own borders for some reason, which
+// is very wrong. It should be calling the proper base class and letting it do
+// the border (and margin and padding) calculations.
void KstViewBox::paint(KstPainter& p, const QRegion& bounds) {
p.save();
- if (p.type() != KstPainter::P_PRINT && p.type() != KstPainter::P_EXPORT) {
- if (p.makingMask()) {
+ if (p.makingMask()) {
+ if (p.type() != KstPainter::P_PRINT && p.type() != KstPainter::P_EXPORT) {
p.setRasterOp(Qt::SetROP);
- KstViewObject::paint(p, bounds);
- } else {
+ }
+ KstViewObject::paint(p, bounds);
+ } else {
+ KstViewObject::paint(p, bounds);
+ // FIXME: inefficient
+ if (p.type() != KstPainter::P_PRINT && p.type() != KstPainter::P_EXPORT) {
QRegion boundary = bounds & _lastClipRegion;
- KstViewObject::paint(p, bounds);
- // FIXME: inefficient
for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
boundary -= (*i)->clipRegion();
}
--- trunk/extragear/graphics/kst/kst/kstviewellipse.cpp #489909:489910
@@ -60,14 +60,16 @@
void KstViewEllipse::paint(KstPainter& p, const QRegion& bounds) {
p.save();
- if (p.type() != KstPainter::P_PRINT && p.type() != KstPainter::P_EXPORT) {
- if (p.makingMask()) {
+ if (p.makingMask()) {
+ if (p.type() != KstPainter::P_PRINT && p.type() != KstPainter::P_EXPORT) {
p.setRasterOp(Qt::SetROP);
- KstViewObject::paint(p, bounds);
- } else {
+ }
+ KstViewObject::paint(p, bounds);
+ } else {
+ KstViewObject::paint(p, bounds);
+ // FIXME: inefficient
+ if (p.type() != KstPainter::P_PRINT && p.type() != KstPainter::P_EXPORT) {
QRegion boundary = bounds & _lastClipRegion;
- KstViewObject::paint(p, bounds);
- // FIXME: inefficient
for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
boundary -= (*i)->clipRegion();
}
@@ -83,8 +85,7 @@
} else {
p.setBrush(_foregroundColor);
}
- p.drawEllipse(geometry().x() + _borderWidth/2, geometry().y() + _borderWidth/2,
- geometry().width() - _borderWidth, geometry().height() - _borderWidth);
+ p.drawEllipse(geometry().x() + _borderWidth/2, geometry().y() + _borderWidth/2, geometry().width() - _borderWidth, geometry().height() - _borderWidth);
p.restore();
}
--- trunk/extragear/graphics/kst/kst/kstviewobject.cpp #489909:489910
@@ -1581,7 +1581,6 @@
paint(p, QRegion());
p.flush();
p.end();
- p.setMakingMask(false);
_clipMask = QRegion(bm);
} else {
_clipMask = QRegion();
More information about the Kst
mailing list