diff --git a/antonclk/antonclk.app.js b/antonclk/antonclk.app.js index 0e7f42b..fd88c77 100644 --- a/antonclk/antonclk.app.js +++ b/antonclk/antonclk.app.js @@ -54,14 +54,14 @@ var dateStr = date.getDate() + " " + days[date.getDay()] + " " + temperature; // don't draw date string if stopwatch 2 is running - if (!stopWatch.start2) { + if (!stopWatch.start2 && !stopWatch.elapsed2) { g.setFontAlign(0, 0).setFont("Vector", 26).drawString(dateStr, x, y+76); } //var wrapped = g.wrapString(myMessage, g.getWidth()-10).join("\n"); // don't draw message if stopwatch 1 is running - if (!stopWatch.start1) { + if (!stopWatch.start1 && !stopWatch.elapsed1) { g.setFontAlign(0, 0).setFont("Vector", 26).drawString(myMessage, x, y-45); } }; @@ -224,7 +224,6 @@ stopWatch1Timer = null; } } - drawStopWatches(); }; let stopSW1 = function() { @@ -238,8 +237,6 @@ stopWatch1Timer = null; } } - paintFace(); - drawStopWatches(); }; let pauseSW2 = function() { @@ -254,7 +251,6 @@ stopWatch1Timer = null; } } - drawStopWatches(); }; let stopSW2 = function() { @@ -268,8 +264,6 @@ stopWatch1Timer = null; } } - paintFace(); - drawStopWatches(); }; @@ -363,7 +357,10 @@ } myMessage = key; - if (paintFace) paintFace(); + if (paintFace) { + paintFace(); + drawStopWatches(); + } } }; @@ -411,6 +408,12 @@ // Load widgets Bangle.loadWidgets(); paintFace(); + drawStopWatches(); + if (stopWatch.start1 || stopWatch.start2) { + if (!stopWatch1Timer) { + stopWatch1Timer = setInterval(drawStopWatches, 100); + } + } draw(); setTimeout(Bangle.drawWidgets,0); }