fix minute tick bug
parent
4e331e58cf
commit
37b1e38e7f
|
|
@ -2683,7 +2683,7 @@
|
|||
{
|
||||
"id": "multiclock",
|
||||
"name": "Multi Clock",
|
||||
"version": "0.07",
|
||||
"version": "0.08",
|
||||
"description": "Clock with multiple faces. Switch between faces with BTN1 & BTN3 or swipe left-right. For best display set theme Background 2 to cyan or some other bright colour in settings.",
|
||||
"icon": "multiclock.png",
|
||||
"type": "clock",
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
0.05: make Bangle compatible
|
||||
0.06: add minute tick for efficiency and nifty A clock
|
||||
0.07: compatible with Bang;e.js 2
|
||||
0.08: fix minute tick bug
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -14,11 +14,12 @@ function stopdraw() {
|
|||
g.clear();
|
||||
}
|
||||
|
||||
function queueMinuteTick(f) {
|
||||
if (tickTimeout) clearTimeout(drawTimeout);
|
||||
function queueMinuteTick() {
|
||||
if (tickTimeout) clearTimeout(tickTimeout);
|
||||
tickTimeout = setTimeout(function() {
|
||||
tickTimeout = undefined;
|
||||
f();
|
||||
face.tick();
|
||||
queueMinuteTick();
|
||||
}, 60000 - (Date.now() % 60000));
|
||||
}
|
||||
|
||||
|
|
@ -28,7 +29,7 @@ function startdraw() {
|
|||
if (face.tickpersec)
|
||||
intervalRefSec = setInterval(face.tick,1000);
|
||||
else
|
||||
queueMinuteTick(face.tick);
|
||||
queueMinuteTick();
|
||||
Bangle.drawWidgets();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue