mirror of https://github.com/espruino/BangleApps
[ClockFace] Fix widget drawing
parent
2aa56bdaf2
commit
621864da24
|
@ -58,7 +58,6 @@ ClockFace.prototype.tick = function() {
|
||||||
};
|
};
|
||||||
if (!this._last) {
|
if (!this._last) {
|
||||||
g.clear(true);
|
g.clear(true);
|
||||||
if (global.WIDGETS) Bangle.drawWidgets();
|
|
||||||
g.reset();
|
g.reset();
|
||||||
this.draw.apply(this, [time, {d: true, h: true, m: true, s: true}]);
|
this.draw.apply(this, [time, {d: true, h: true, m: true, s: true}]);
|
||||||
} else {
|
} else {
|
||||||
|
@ -70,6 +69,7 @@ ClockFace.prototype.tick = function() {
|
||||||
g.reset();
|
g.reset();
|
||||||
this.update.apply(this, [time, c]);
|
this.update.apply(this, [time, c]);
|
||||||
}
|
}
|
||||||
|
if (global.WIDGETS) Bangle.drawWidgets();
|
||||||
this._last = now;
|
this._last = now;
|
||||||
if (this.paused) return; // called redraw() while still paused
|
if (this.paused) return; // called redraw() while still paused
|
||||||
// figure out timeout: if e.g. precision=60s, update at the start of a new minute
|
// figure out timeout: if e.g. precision=60s, update at the start of a new minute
|
||||||
|
@ -103,12 +103,13 @@ ClockFace.prototype.pause = function() {
|
||||||
this.paused = true; // apps might want to check this
|
this.paused = true; // apps might want to check this
|
||||||
if (this._pause) this._pause.apply(this);
|
if (this._pause) this._pause.apply(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
ClockFace.prototype.resume = function() {
|
ClockFace.prototype.resume = function() {
|
||||||
if (this._timeout) return; // not paused
|
if (this._timeout) return; // not paused
|
||||||
delete this._last;
|
delete this._last;
|
||||||
this.paused = false;
|
this.paused = false;
|
||||||
if (this._resume) this._resume.apply(this);
|
if (this._resume) this._resume.apply(this);
|
||||||
this.tick(true);
|
this.tick();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue