From 246d945f39166c7b4b519ed43723cb985afdfee5 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Fri, 14 Apr 2023 14:13:45 +0200 Subject: [PATCH] another "inner var shadows outer var" Seems this is not causing bugs, however its still bad style to re-define existing vars in an inner loop. Solved to improve code readability. --- wled00/FX.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index 2f5e9fdc6..2b5c81418 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -4653,8 +4653,8 @@ uint16_t mode_2DColoredBursts() { // By: ldirko https://editor.so byte ysteps = abs8(x2 - y2) + 1; byte steps = xsteps >= ysteps ? xsteps : ysteps; //Draw gradient line - for (size_t i = 1; i <= steps; i++) { - uint8_t rate = i * 255 / steps; + for (size_t j = 1; j <= steps; j++) { + uint8_t rate = j * 255 / steps; byte dx = lerp8by8(x1, y1, rate); byte dy = lerp8by8(x2, y2, rate); //SEGMENT.setPixelColorXY(dx, dy, grad ? color.nscale8_video(255-rate) : color); // use addPixelColorXY for different look