diff --git a/apps/miclock2/ChangeLog b/apps/miclock2/ChangeLog index 5560f00bc..55c60accd 100644 --- a/apps/miclock2/ChangeLog +++ b/apps/miclock2/ChangeLog @@ -1 +1,2 @@ 0.01: New App! +0.02: Redraw only when seconds change diff --git a/apps/miclock2/clock-mixed.js b/apps/miclock2/clock-mixed.js index d928a5185..edc68959c 100644 --- a/apps/miclock2/clock-mixed.js +++ b/apps/miclock2/clock-mixed.js @@ -6,6 +6,7 @@ const Radius = { "center": 7, "hour": 60, "min": 80, "dots": 88 }; const Center = { "x": 120, "y": 96 }; const Widths = { hour: 2, minute: 2 }; var buf = Graphics.createArrayBuffer(240,192,1,{msb:true}); +var lastDate = new Date(); function rotatePoint(x, y, d) { rad = -1 * d / 180 * Math.PI; @@ -45,10 +46,10 @@ function setLineWidth(x1, y1, x2, y2, lw) { ]; } - function drawMixedClock(force) { - if ((force || Bangle.isLCDOn()) && buf.buffer) { - var date = new Date(); + var date = new Date(); + if ((force || Bangle.isLCDOn()) && buf.buffer && date.getSeconds() === lastDate.getSeconds()) { + lastDate = date; var dateArray = date.toString().split(" "); var isEn = locale.name.startsWith("en"); var point = []; diff --git a/apps/miclock2/metadata.json b/apps/miclock2/metadata.json index dc1b49822..e1481dbd2 100644 --- a/apps/miclock2/metadata.json +++ b/apps/miclock2/metadata.json @@ -1,7 +1,7 @@ { "id": "miclock2", "name": "Mixed Clock 2", - "version": "0.01", + "version": "0.02", "description": "White color variant of the Mixed Clock with thicker clock hands for better readability in the bright sunlight, extra space under the clock for widgets and seconds in the digital clock.", "icon": "clock-mixed.png", "type": "clock",