Skip to content

Commit

Permalink
Bar clock: fix SyntaxError
Browse files Browse the repository at this point in the history
Seems the app still works though
(Snuck in during code cleanup, I'm blaming autoformat)
  • Loading branch information
rigrig committed Apr 1, 2020
1 parent 461c580 commit 2c76963
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps.json
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@
{ "id": "barclock",
"name": "Bar Clock",
"icon": "clock-bar.png",
"version":"0.03",
"version":"0.04",
"description": "A simple digital clock showing seconds as a bar",
"tags": "clock",
"type":"clock",
Expand Down
1 change: 1 addition & 0 deletions apps/barclock/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
0.01: Created Bar Clock
0.02: Apply locale, 12-hour setting
0.03: Fix dates drawing over each other at midnight
0.04: Small bugfix
5 changes: 4 additions & 1 deletion apps/barclock/clock-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@
const drawBar = function (date) {
const b = settings.bar
const seconds = date.getSeconds()
if (seconds === 0) return // zero-size rect stills draws one line of pixels
if (seconds === 0) {
// zero-size rect stills draws one line of pixels, we don't want that
return
}
const fraction = seconds / SECONDS_PER_MINUTE,
width = fraction * screen.width
g.setColor(b.color)
Expand Down

0 comments on commit 2c76963

Please sign in to comment.