diff options
author | Fabien Freling <fabien.freling@nokia.com> | 2010-02-25 10:54:54 (GMT) |
---|---|---|
committer | Fabien Freling <fabien.freling@nokia.com> | 2010-02-25 11:01:41 (GMT) |
commit | 8eaeb1d4415d19a43b20fffe46c2b29fd609bba1 (patch) | |
tree | 0f91c15ee3459a5d9c82060ea6e6bc2b6064637e /src/gui | |
parent | f446c5c356f3f805e988eef41edb4acbdb2fb5fc (diff) | |
download | Qt-8eaeb1d4415d19a43b20fffe46c2b29fd609bba1.zip Qt-8eaeb1d4415d19a43b20fffe46c2b29fd609bba1.tar.gz Qt-8eaeb1d4415d19a43b20fffe46c2b29fd609bba1.tar.bz2 |
Revert changes made in scroll_sys().
The optimization created some glitches. It now
works properly but it could be improved
performance-wise.
Task-number: QTBUG-5926
Task-number: QTBUG-5994
Reviewed-by: Morten Sorvig
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qwidget_mac.mm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 9e7517f..f78596e 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -4475,8 +4475,20 @@ void QWidgetPrivate::scroll_sys(int dx, int dy, const QRect &r) } } + // ### Scroll the dirty regions as well, the following is not correct. + QRegion displayRegion = r.isNull() ? dirtyOnWidget : (dirtyOnWidget & r); + const QVector<QRect> &rects = dirtyOnWidget.rects(); + const QVector<QRect>::const_iterator end = rects.end(); + QVector<QRect>::const_iterator it = rects.begin(); + while (it != end) { + const QRect rect = *it; + const NSRect dirtyRect = NSMakeRect(rect.x() + dx, rect.y() + dy, + rect.width(), rect.height()); + [view setNeedsDisplayInRect:dirtyRect]; + ++it; + } + NSSize deltaSize = NSMakeSize(dx, dy); - [view translateRectsNeedingDisplayInRect:scrollRect by:deltaSize]; [view scrollRect:scrollRect by:deltaSize]; [view setNeedsDisplayInRect:deltaXRect]; [view setNeedsDisplayInRect:deltaYRect]; |