If midnight clear the display to clean up artifacts

Since slash is (wisely) very conservative about clearing / redrawing, artifacts from past dates that aren't overwritten tend to stack up. On my watch now where it says "Sun 9/18" there is some left over "T" from last Thursday sticking out to the left of the "S" in "Sun", and some leftover "6" sticking out to the right of the "8" in "18" from two days ago. This should clear everything once a day at midnight so these artifacts get cleared out.
pull/2127/head
Amos Blanton 2022-09-18 09:28:11 +00:00 committed by GitHub
parent 88533f84bc
commit 2254fdd049
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -57,6 +57,10 @@ function draw() {
var minutes = ("0"+m).substr(-2);
g.reset();
// If midnight clear display to remove day / date artifacts
if (h == 0 && m == 0)
g.clear();
// Convert to 12hr time mode
if (is12Hour && h > 12) {
h = h - 12;