From 13104d84e834af43aacb1420b896d041d60d7f07 Mon Sep 17 00:00:00 2001 From: Markus Ransberger Date: Fri, 3 Nov 2023 01:21:05 +0100 Subject: [PATCH] Spiral size fix. --- src/wordclock_esp8266.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wordclock_esp8266.cpp b/src/wordclock_esp8266.cpp index 7ec7a5c..ba974ff 100644 --- a/src/wordclock_esp8266.cpp +++ b/src/wordclock_esp8266.cpp @@ -335,18 +335,18 @@ void handle_current_state() } case ST_SPIRAL: // state spiral { - int res = draw_spiral(false, spiral_direction, MATRIX_WIDTH - 1); - if (res && spiral_direction == 0) + int res = draw_spiral(false, spiral_direction, MATRIX_WIDTH - 2); + if ((bool)res && spiral_direction == 0) { // change spiral direction to closing (draw empty leds) - spiral_direction = 1; + spiral_direction = true; // init spiral with new spiral direction draw_spiral(true, spiral_direction, MATRIX_WIDTH - 1); } else if (res && spiral_direction == 1) { // reset spiral direction to normal drawing leds - spiral_direction = 0; + spiral_direction = false; // init spiral with new spiral direction draw_spiral(true, spiral_direction, MATRIX_WIDTH - 1); }