Decoupled updating ring and text

master
David Volovskiy 2025-05-18 13:47:32 -04:00
parent 981826c25b
commit f62dd11d25
1 changed files with 3 additions and 5 deletions

View File

@ -29,6 +29,8 @@ const infoHeightDefault = 11;
const ringEdge = 4; const ringEdge = 4;
const ringIterOffset = 10; const ringIterOffset = 10;
const ringThick = 6; const ringThick = 6;
const minStepToUpdate = 10; // In number of steps as a minumum to update the text.
const minStepPctUpdateRings = 3; // If the current step is less percent than last updated, don't redraw the rings
let nextUpdateMs; let nextUpdateMs;
var drawingSteps = false; var drawingSteps = false;
var innerMostRing = 0; var innerMostRing = 0;
@ -537,11 +539,7 @@ function drawClock() {
function checkRedrawSteps(steps) { function checkRedrawSteps(steps) {
var redrawText = false; var redrawText = false;
var redrawRings = false; var redrawRings = false;
const minStepToUpdate = 10; // In number of steps as a minumum to update either the rings or text. if (infoMode == "ID_STEP" && (minStepToUpdate <= (steps - prevStepDisplayed))) {
const minStepPctUpdateRings = 3; // If the current step is less percent than last updated, don't redraw the rings
if (minStepToUpdate > (steps - prevStepDisplayed)) return [redrawText, redrawRings];
prevStepDisplayed = steps;
if (infoMode == "ID_STEP") {
redrawText = true; redrawText = true;
} }
for (let i = 0; i < settings.rings.length; i++) { for (let i = 0; i < settings.rings.length; i++) {