diff --git a/apps.json b/apps.json index aab3389a1..d6daa2f5c 100644 --- a/apps.json +++ b/apps.json @@ -919,7 +919,7 @@ { "id": "barclock", "name": "Bar Clock", "icon": "clock-bar.png", - "version":"0.02", + "version":"0.03", "description": "A simple digital clock showing seconds as a bar", "tags": "clock", "type":"clock", diff --git a/apps/barclock/ChangeLog b/apps/barclock/ChangeLog index a8d2f5485..89f5a1d58 100644 --- a/apps/barclock/ChangeLog +++ b/apps/barclock/ChangeLog @@ -1,2 +1,3 @@ 0.01: Created Bar Clock 0.02: Apply locale, 12-hour setting +0.03: Fix dates drawing over each other at midnight diff --git a/apps/barclock/clock-bar.js b/apps/barclock/clock-bar.js index 5ab9c433e..21d41da8a 100644 --- a/apps/barclock/clock-bar.js +++ b/apps/barclock/clock-bar.js @@ -59,7 +59,7 @@ g.setFont(timeFont, timeFontSize) g.drawString(timeTexts.time, screenCenter, timeY, true) if (timeTexts.ampm !== '') { - g.setFontAlign(1, -1) + g.setFontAlign(1, -1) // right top g.setFont(timeFont, ampmFontSize) g.drawString(timeTexts.ampm, // at right edge of screen , aligned with time bottom @@ -78,11 +78,10 @@ const fraction = seconds / SECONDS_PER_MINUTE g.fillRect(0, barY, fraction * screenSize, barY + barThickness) } - function eraseBar() { - const color = g.getColor() - g.setColor(g.getBgColor()) - g.fillRect(0, barY, screenSize, barY + barThickness) - g.setColor(color) + function clearScreen() { + g.setColor(0) + g.fillRect(0, timeY - (timeFontSize * 4), screenSize, screenSize) + g.setColor(-1) } let lastSeconds @@ -92,7 +91,7 @@ const seconds = date.getSeconds() if (lastSeconds > seconds) { // new minute - eraseBar() + clearScreen() drawDateTime(date) } drawBar(date)