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.
This commit is contained in:
Frank 2023-04-14 14:13:45 +02:00
parent 4a3bc486d0
commit 246d945f39

View File

@ -4653,8 +4653,8 @@ uint16_t mode_2DColoredBursts() { // By: ldirko https://editor.so
byte ysteps = abs8(x2 - y2) + 1; byte ysteps = abs8(x2 - y2) + 1;
byte steps = xsteps >= ysteps ? xsteps : ysteps; byte steps = xsteps >= ysteps ? xsteps : ysteps;
//Draw gradient line //Draw gradient line
for (size_t i = 1; i <= steps; i++) { for (size_t j = 1; j <= steps; j++) {
uint8_t rate = i * 255 / steps; uint8_t rate = j * 255 / steps;
byte dx = lerp8by8(x1, y1, rate); byte dx = lerp8by8(x1, y1, rate);
byte dy = lerp8by8(x2, y2, rate); byte dy = lerp8by8(x2, y2, rate);
//SEGMENT.setPixelColorXY(dx, dy, grad ? color.nscale8_video(255-rate) : color); // use addPixelColorXY for different look //SEGMENT.setPixelColorXY(dx, dy, grad ? color.nscale8_video(255-rate) : color); // use addPixelColorXY for different look