corrected variables

master
David Volovskiy 2025-05-04 22:13:56 -04:00
parent 1bb077be7a
commit 213485b3aa
1 changed files with 6 additions and 6 deletions

View File

@ -308,12 +308,12 @@ function drawGaugeImage(date) {
break;
case 'Sun':
var dayMin = getMinutesFromDate(date);
if (dayMin >= sunEnd && dayMin <= night) ring_fill = max;
if (dayMin >= sunEnd && dayMin <= night) ring_fill = ring_max;
else {
ring_fill = max * (date - sunStart) / sunFull;
if (ring_fill > max) { // If we're now past a sunrise of sunset
ring_fill = ring_max * (date - sunStart) / sunFull;
if (ring_fill > ring_max) { // If we're now past a sunrise of sunset
updateSunRiseSunSet(date, location.lat, location.lon, true);
ring_fill = max * (date - sunStart) / sunFull;
ring_fill = ring_max * (date - sunStart) / sunFull;
}
}
invertRing = !isDaytime;
@ -322,8 +322,8 @@ function drawGaugeImage(date) {
var start = 0;
var end = ring_fill;
if (invertRing) {
start = max - end;
end = max;
start = ring_max - end;
end = ring_max;
}
if (end !== prevRing.end || start !== prevRing.start || ring_max !== prevRing.max) {
drawRing(start, end, ring_max);