Fix Segment::fade_out for 2d expansion

Since we're using get/setPixelColorRaw, we need the true length, not
the virtual length.
This commit is contained in:
Will Miles 2025-06-07 11:08:11 -04:00
parent 8b65d873b3
commit 4abaf13598

View File

@ -989,7 +989,8 @@ void Segment::fade_out(uint8_t rate) const {
if (!isActive()) return; // not active
rate = (256-rate) >> 1;
const int mappedRate = 256 / (rate + 1);
for (unsigned j = 0; j < vLength(); j++) {
const size_t length = is2D() ? (vWidth() * vHeight()) : vLength();
for (unsigned j = 0; j < length; j++) {
uint32_t color = getPixelColorRaw(j);
if (color == colors[1]) continue; // already at target color
for (int i = 0; i < 32; i += 8) {