From 441aff9d01a1530d2b187098c7c47bc683116a66 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Fri, 12 Feb 2010 16:42:42 +0100 Subject: Fix QRegion under Mac OS X. Now it takes the intersection of QRects for the region to repaint instead of taking the bounding box. --- src/gui/kernel/qcocoaview_mac.mm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 8c5d166..aa00e97 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -488,7 +488,15 @@ extern "C" { qWarning("QWidget::repaint: Recursive repaint detected"); const QRect qrect = QRect(aRect.origin.x, aRect.origin.y, aRect.size.width, aRect.size.height); - QRegion qrgn(qrect); + QRegion qrgn; + + const NSRect *rects; + NSInteger count; + [self getRectsBeingDrawn:&rects count:&count]; + for (int i = 0; i < count; ++i) { + QRect tmpRect = QRect(rects[i].origin.x, rects[i].origin.y, rects[i].size.width, rects[i].size.height); + qrgn += tmpRect; + } if (!qwidget->isWindow() && !qobject_cast(qwidget->parent())) { const QRegion &parentMask = qwidget->window()->mask(); -- cgit v0.12