| Summary: | Problem when resizing window with label | ||
|---|---|---|---|
| Product: | [Applications] kst | Reporter: | Andrew Walker <arwalker> |
| Component: | general | Assignee: | George Staikos <staikos> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | kst |
| Priority: | NOR | ||
| Version First Reported In: | 1.x | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Andrew Walker
2005-10-21 00:35:20 UTC
Confirmed At least one problem is that the geometry of the labels is not updated yet (they're auto-adjusted), so the mask for the toplevel view is wrong. Maybe it should paint last. I will test this. SVN commit 472825 by staikos:
paint objects top->down instead of bottom->up to make sure we don't get inproper
geometries or artifacts. As a side effect, painting goes from O(n^2) to O(n)
which is nice.
BUG: 114788
M +4 -2 ksttoplevelview.cpp
M +8 -10 kstviewobject.cpp
--- trunk/extragear/graphics/kst/kst/ksttoplevelview.cpp #472824:472825
@@ -180,10 +180,13 @@
void KstTopLevelView::paint(KstPaintType type, const QRegion& bounds) {
- QRegion boundary = bounds;
QPainter p;
p.begin(_w);
p.setViewXForm(true);
+ // Paint everything else first so that geometries are properly updated.
+ paint(type, p, bounds);
+
+ QRegion boundary = bounds;
for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
boundary -= (*i)->clipRegion();
}
@@ -191,7 +194,6 @@
p.setClipRegion(boundary);
p.fillRect(geometry(), QBrush(_backgroundColor));
p.setClipping(false);
- paint(type, p, bounds);
}
p.end();
--- trunk/extragear/graphics/kst/kst/kstviewobject.cpp #472824:472825
@@ -309,29 +309,27 @@
}
}
- if (!maximized) {
- for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
+ if (!maximized && !_children.isEmpty()) {
+ QRegion clipRegion = oldRegion;
+ KstViewObjectList::Iterator begin = _children.begin();
+ for (KstViewObjectList::Iterator i = _children.fromLast();; --i) {
if (nullBounds || !bounds.intersect(QRegion((*i)->geometry())).isEmpty()) {
#ifdef BENCHMARK
QTime t;
t.start();
#endif
- QRegion clipRegion = oldRegion;
- KstViewObjectList::Iterator j = i;
- for (++j; j != _children.end(); ++j) {
- clipRegion -= (*j)->clipRegion();
- }
(*i)->_lastClipRegion = clipRegion;
p.setClipRegion(clipRegion);
(*i)->paint(type, p, bounds);
+ clipRegion -= (*i)->clipRegion();
#ifdef BENCHMARK
int x = t.elapsed();
kstdDebug() << " -> object " << (*i)->tagName() << " took " << x << "ms" << endl;
#endif
- if ((*i)->_maximized) {
- break;
- }
}
+ if (i == begin) {
+ break;
+ }
}
}
|