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
Richard de Boer 2022-06-19 20:00:18 +02:00
parent 3bddcd402d
commit 6090b453c3
No known key found for this signature in database
GPG Key ID: 8721727971871937
1 changed files with 1 additions and 1 deletions

View File

@ -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";