Skip to content

Commit 16a8877

Browse files
committed
Revert changes to blur()
No need to rely on a sufficiently smart compiler.
1 parent 94f226a commit 16a8877

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

wled00/FX_fcn.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,12 +1038,12 @@ void Segment::blur(uint8_t blur_amount, bool smear) const {
10381038
#endif
10391039
uint8_t keep = smear ? 255 : 255 - blur_amount;
10401040
uint8_t seep = blur_amount >> 1;
1041-
unsigned rlength = rawLength();
1041+
unsigned vlength = vLength();
10421042
uint32_t carryover = BLACK;
10431043
uint32_t lastnew; // not necessary to initialize lastnew and last, as both will be initialized by the first loop iteration
10441044
uint32_t last;
10451045
uint32_t curnew = BLACK;
1046-
for (unsigned i = 0; i < rlength; i++) {
1046+
for (unsigned i = 0; i < vlength; i++) {
10471047
uint32_t cur = getPixelColorRaw(i);
10481048
uint32_t part = color_fade(cur, seep);
10491049
curnew = color_fade(cur, keep);
@@ -1057,7 +1057,7 @@ void Segment::blur(uint8_t blur_amount, bool smear) const {
10571057
last = cur; // save original value for comparison on next iteration
10581058
carryover = part;
10591059
}
1060-
setPixelColorRaw(rlength - 1, curnew);
1060+
setPixelColorRaw(vlength - 1, curnew);
10611061
}
10621062

10631063
/*

0 commit comments

Comments
 (0)