summaryrefslogtreecommitdiff
path: root/metawatch/metawatchpaintengine.cpp
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2011-09-26 02:36:09 +0200
committerJavier S. Pedro <maemo@javispedro.com>2011-09-26 02:36:09 +0200
commit0822b88738e00625efd27ccca9119885272924d2 (patch)
treef379817602cc23dd829c0aa4751b6b5edc348923 /metawatch/metawatchpaintengine.cpp
parentcf5d24b94d96b722c6d76c2225293a56a50d3c2b (diff)
downloadsowatch-0822b88738e00625efd27ccca9119885272924d2.tar.gz
sowatch-0822b88738e00625efd27ccca9119885272924d2.zip
fixing bugs found during use ;)
Diffstat (limited to 'metawatch/metawatchpaintengine.cpp')
-rw-r--r--metawatch/metawatchpaintengine.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/metawatch/metawatchpaintengine.cpp b/metawatch/metawatchpaintengine.cpp
index 58a7b9d..1b449ab 100644
--- a/metawatch/metawatchpaintengine.cpp
+++ b/metawatch/metawatchpaintengine.cpp
@@ -3,24 +3,25 @@
using namespace sowatch;
+const QRect MetaWatchPaintEngine::totalAreaRect(0, 0, MetaWatch::screenWidth, MetaWatch::screenHeight);
+
MetaWatchPaintEngine::MetaWatchPaintEngine(MetaWatch* watch) :
- WatchPaintEngine(watch), _watch(watch),
- _imageRect(0, 0, MetaWatch::screenWidth, MetaWatch::screenHeight)
+ WatchPaintEngine(),
+ _watch(watch)
{
}
bool MetaWatchPaintEngine::begin(QPaintDevice *pdev)
{
- _damaged = QRegion();
_watch = static_cast<MetaWatch*>(pdev);
_mode = _watch->paintTargetMode();
- return _painter.begin(_watch->imageFor(_mode));
+ return WatchPaintEngine::begin(_watch->imageFor(_mode));
}
bool MetaWatchPaintEngine::end()
{
- bool ret = _painter.end();
+ bool ret = WatchPaintEngine::end();
if (ret) {
_watch->update(_mode, _damaged.rects().toList());
}
@@ -94,7 +95,7 @@ void MetaWatchPaintEngine::updateState(const QPaintEngineState &state)
bool MetaWatchPaintEngine::fillsEntireImage(const QRect& rect)
{
- return rect == _imageRect &&
+ return rect == totalAreaRect &&
(!_clipEnabled ||
- (_clipRegion.numRects() == 1 && _clipRegion.rects().at(0) == _imageRect));
+ (_clipRegion.numRects() == 1 && _clipRegion.rects().at(0) == totalAreaRect));
}