mirror of
https://github.com/wled/WLED.git
synced 2025-07-16 07:16:31 +00:00
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:
parent
8b65d873b3
commit
4abaf13598
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user