[Kst] [Bug 123561] ellipse fails to clip child objects
Andrew Walker
arwalker at sumusltd.com
Tue Aug 28 23:03:56 CEST 2007
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=123561
------- Additional Comments From arwalker sumusltd com 2007-08-28 23:03 -------
SVN commit 705903 by arwalker:
CCBUG:123561 ensure clip region is correctly updated after deleting objects via the shortcut
M +2 -0 ksttoplevelview.cpp
M +1 -1 kstviewellipse.cpp
M +9 -1 kstviewobject.cpp
--- branches/work/kst/1.5/kst/src/libkstapp/ksttoplevelview.cpp #705902:705903
@ -1860,7 +1860,9 @
void KstTopLevelView::deleteSelectedObjects() {
for (KstViewObjectList::Iterator i = _selectionList.begin(); i != _selectionList.end(); ++i) {
KstViewObjectPtr selection = *i;
+
if (selection && selection->parent()) {
+ selection->parent()->invalidateClipRegion();
selection->parent()->removeChild(selection);
}
}
--- branches/work/kst/1.5/kst/src/libkstapp/kstviewellipse.cpp #705902:705903
@ -230,4 +230,4 @
#include "kstviewellipse.moc"
-// vim: ts=2 sw=2 et
+
--- branches/work/kst/1.5/kst/src/libkstapp/kstviewobject.cpp #705902:705903
@ -307,12 +307,14 @
void KstViewObject::paint(KstPainter& p, const QRegion& bounds) {
bool maximized = false;
+
if (p.type() == KstPainter::P_EXPORT || p.type() == KstPainter::P_PRINT) {
// handle the case where we have maximized plots
for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
if ((*i)->_maximized) {
(*i)->paint(p, bounds);
maximized = true;
+
break;
}
}
@ -323,6 +325,7 @
(*i)->paint(p, bounds);
}
}
+
return;
}
@ -346,12 +349,14 @
if ((*i)->_maximized) {
(*i)->paint(p, bounds);
maximized = true;
+
break;
}
}
if (!maximized) {
QRegion clipRegion;
+
if (nullBounds) {
clipRegion = geometry();
} else {
@ -362,6 +367,7 @
KstViewObjectList::Iterator begin = _children.begin();
for (KstViewObjectList::Iterator i = _children.fromLast();; --i) {
const QRegion thisObjectGeometry((*i)->geometry());
+
if (nullBounds || !clipRegion.intersect(thisObjectGeometry).isEmpty()) {
#ifdef BENCHMARK
QTime t;
@ -1305,14 +1311,16 @
if (_topObjectForMenu) {
KstTopLevelViewPtr tlv = kst_cast<KstTopLevelView>(KstViewObjectPtr(_topObjectForMenu));
+
if (tlv && vop == tlv->pressTarget()) {
tlv->clearPressTarget();
}
+
if (this->_parent) {
this->_parent->invalidateClipRegion();
}
+
_topObjectForMenu->removeChild(this, true);
-
_topObjectForMenu = 0L;
}
More information about the Kst
mailing list