From 84c65a64e3e2050009dbd2ec82dc64e487e798a4 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Thu, 28 Mar 2013 20:42:25 +0100 Subject: trying new partial lcd update command --- metawatch/metawatchdigital.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'metawatch') diff --git a/metawatch/metawatchdigital.cpp b/metawatch/metawatchdigital.cpp index 31f3276..9d0d376 100644 --- a/metawatch/metawatchdigital.cpp +++ b/metawatch/metawatchdigital.cpp @@ -124,17 +124,20 @@ void MetaWatchDigital::update(Mode mode, const QList &rects) if (!_connected) return; const QRect clipRect(0, 0, screenWidth, screenHeight); QVector lines(screenHeight, false); + int highest = 0, lowest = screenHeight; foreach (const QRect& rect, rects) { QRect r = rect.intersect(clipRect); for (int i = r.top(); i <= r.bottom(); i++) { + if (i < highest) highest = i; + if (i > lowest) lowest = i; lines[i] = true; } } updateLcdLines(mode, _image[mode], lines); if (mode == _currentMode) { - updateLcdDisplay(mode); + updateLcdDisplay(mode, lowest, highest); } } -- cgit v1.2.3