mirror of https://github.com/espruino/BangleApps
ClockFace: don't erase widgets when using `draw`
If a clock specifies `draw` but not `update`, we create our own `update`, but it should only erase the clock area, not the whole screen.pull/1985/head
parent
3bddcd402d
commit
6090b453c3
|
@ -19,7 +19,7 @@ function ClockFace(options) {
|
|||
options.update.apply(this, [t, {d: true, h: true, m: true, s: true}]);
|
||||
});
|
||||
this.update = options.update || (t => {
|
||||
g.clear();
|
||||
g.clearRect(Bangle.appRect);
|
||||
options.draw.apply(this, [t, {d: true, h: true, m: true, s: true}]);
|
||||
});
|
||||
if (options.precision===1000||options.precision===60000) throw "ClockFace precision is in seconds, not ms";
|
||||
|
|
Loading…
Reference in New Issue