im getting tired of debugging like this

This commit is contained in:
jane 2021-05-26 10:53:17 -04:00
parent 6c866b37fe
commit df986ff032

View file

@ -82,24 +82,24 @@ function fade(index) {
var current_tick_b = Math.abs(Math.floor((diff_cb / diff_b) * fade_ticks)); var current_tick_b = Math.abs(Math.floor((diff_cb / diff_b) * fade_ticks));
if (diff_r == 0) { if (diff_r == 0) {
current_tick_r = fade_ticks; current_tick_r = fade_ticks;
} else if (Math.abs(current.r + interval_r) >= Math.abs(final.r)) {
current.r = final.r;
interval_r = 0;
current_tick_r = fade_ticks;
} }
if (diff_g == 0) { if (diff_g == 0) {
current_tick_g = fade_ticks; current_tick_g = fade_ticks;
} else if (Math.abs(current.g + interval_g) >= Math.abs(final.g)) {
current.g = final.g;
interval_g = 0;
current_tick_g = fade_ticks;
} }
if (diff_b == 0) { if (diff_b == 0) {
current_tick_b = fade_ticks; current_tick_b = fade_ticks;
} } else if (Math.abs(current.b + interval_b) >= Math.abs(final.b)) {
if (Math.abs(current.r + interval_r) >= Math.abs(final.r)) {
current.r = final.r;
interval_r = 0;
}
if (Math.abs(current.g + interval_g) >= Math.abs(final.g)) {
current.g = final.g;
interval_g = 0;
}
if (Math.abs(current.b + interval_b) >= Math.abs(final.b)) {
current.b = final.b; current.b = final.b;
interval_b = 0; interval_b = 0;
current_tick_b = fade_ticks;
} }
if (current_tick_r + 1 >= fade_ticks && if (current_tick_r + 1 >= fade_ticks &&