fix minute tick bug
parent
4e331e58cf
commit
37b1e38e7f
|
|
@ -2683,7 +2683,7 @@
|
||||||
{
|
{
|
||||||
"id": "multiclock",
|
"id": "multiclock",
|
||||||
"name": "Multi Clock",
|
"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.",
|
"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",
|
"icon": "multiclock.png",
|
||||||
"type": "clock",
|
"type": "clock",
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
0.05: make Bangle compatible
|
0.05: make Bangle compatible
|
||||||
0.06: add minute tick for efficiency and nifty A clock
|
0.06: add minute tick for efficiency and nifty A clock
|
||||||
0.07: compatible with Bang;e.js 2
|
0.07: compatible with Bang;e.js 2
|
||||||
|
0.08: fix minute tick bug
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,12 @@ function stopdraw() {
|
||||||
g.clear();
|
g.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
function queueMinuteTick(f) {
|
function queueMinuteTick() {
|
||||||
if (tickTimeout) clearTimeout(drawTimeout);
|
if (tickTimeout) clearTimeout(tickTimeout);
|
||||||
tickTimeout = setTimeout(function() {
|
tickTimeout = setTimeout(function() {
|
||||||
tickTimeout = undefined;
|
tickTimeout = undefined;
|
||||||
f();
|
face.tick();
|
||||||
|
queueMinuteTick();
|
||||||
}, 60000 - (Date.now() % 60000));
|
}, 60000 - (Date.now() % 60000));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -28,7 +29,7 @@ function startdraw() {
|
||||||
if (face.tickpersec)
|
if (face.tickpersec)
|
||||||
intervalRefSec = setInterval(face.tick,1000);
|
intervalRefSec = setInterval(face.tick,1000);
|
||||||
else
|
else
|
||||||
queueMinuteTick(face.tick);
|
queueMinuteTick();
|
||||||
Bangle.drawWidgets();
|
Bangle.drawWidgets();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue