diff --git a/apps/daisy/README.md b/apps/daisy/README.md index 1fc2bb5c2..f42d34e2c 100644 --- a/apps/daisy/README.md +++ b/apps/daisy/README.md @@ -23,7 +23,7 @@ See [#1248](https://github.com/espruino/BangleApps/issues/1248) * In the settings, the ring can be set to: * Hours - Displays the ring as though it's the hour hand on an analog clock. * Minutes - Displays the ring as though it's the minute hand on an analog clock. - * Seconds - Displays the ring as though it's the seconds hand on an analog clock. + * Seconds - Displays the ring as though it's the seconds hand on an analog clock. This option uses far more battery than any other option as it updates the screen 60 times more often. * Day - Displays the ring as how much of the day is left. Functionally, it fills the ring half as quickly as the Hours option. * Steps - Displays the ring as the amount of steps taken that day out of Step Target setting. * Battery - Displays the ring as the amount of battery percentage left. diff --git a/apps/daisy/app.js b/apps/daisy/app.js index d01b44280..a3ba4df8a 100644 --- a/apps/daisy/app.js +++ b/apps/daisy/app.js @@ -21,8 +21,11 @@ let pal2; // palette for 50-100% const infoLine = (3*h/4) - 6; const infoWidth = 56; const infoHeight = 11; +const textStartWidth = 28; +const textStartHeight = 44; const sec_update = 1000; // This ms between updates when the ring is in Seconds mode var drawingSteps = false; +var prevRing = {start: null, end: null, max: null}; function log_debug(o) { //print(o); @@ -322,7 +325,10 @@ function drawGaugeImage(date) { start = max - end; end = max; } - drawRing(start, end, ring_max); + if (end !== prevRing.end || start !== prevRing.start || ring_max !== prevRing.max) { + drawRing(start, end, ring_max); + prevRing = {start: start, end: end, max: ring_max}; + } log_debug("Start: "+ start + " end: " +end); } @@ -340,7 +346,7 @@ function drawClock() { g.reset(); g.setColor(g.theme.bg); - g.fillRect(0, 0, w, h); + g.fillRect(textStartWidth, textStartHeight, w-textStartWidth, h-textStartHeight); // Clears the text within the circle drawGaugeImage(date); setLargeFont();