summaryrefslogtreecommitdiff
path: root/metawatchpaintengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'metawatchpaintengine.cpp')
-rw-r--r--metawatchpaintengine.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/metawatchpaintengine.cpp b/metawatchpaintengine.cpp
index 96e78a7..71ad452 100644
--- a/metawatchpaintengine.cpp
+++ b/metawatchpaintengine.cpp
@@ -14,7 +14,7 @@ void MetaWatchPaintEngine::drawRects(const QRectF *rects, int rectCount)
int i;
for (i = 0; i < rectCount; i++) {
const QRectF& r = rects[i];
- if (_hasBrush && r.toRect() == _imageRect && (_isBrushBlack | _isBrushWhite)) {
+ if (_hasBrush && fillsEntireImage(r.toRect()) && (_isBrushBlack | _isBrushWhite)) {
_watch->clear(_isBrushWhite);
_damaged = QRegion();
continue;
@@ -37,7 +37,7 @@ void MetaWatchPaintEngine::drawRects(const QRect *rects, int rectCount)
int i;
for (i = 0; i < rectCount; i++) {
const QRect& r = rects[i];
- if (_hasBrush && r == _imageRect && (_isBrushBlack | _isBrushWhite)) {
+ if (_hasBrush && fillsEntireImage(r) && (_isBrushBlack | _isBrushWhite)) {
_watch->clear(_isBrushWhite);
_damaged = QRegion();
continue;
@@ -73,3 +73,10 @@ void MetaWatchPaintEngine::updateState(const QPaintEngineState &state)
}
}
}
+
+bool MetaWatchPaintEngine::fillsEntireImage(const QRect& rect)
+{
+ return rect == _imageRect &&
+ (!_clipEnabled ||
+ (_clipRegion.numRects() == 1 && _clipRegion.rects().at(0) == _imageRect));
+}