Skip to content

Commit 25223c4

Browse files
authored
fixed bouncing bug (wled#4694)
1 parent 66ad27a commit 25223c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wled00/FX.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9540,10 +9540,10 @@ uint16_t mode_particleSparkler(void) {
95409540
PartSys->sources[i].var = 0; // sparks stationary
95419541
PartSys->sources[i].minLife = 150 + SEGMENT.intensity;
95429542
PartSys->sources[i].maxLife = 250 + (SEGMENT.intensity << 1);
9543-
uint32_t speed = SEGMENT.speed >> 1;
9543+
int32_t speed = SEGMENT.speed >> 1;
95449544
if (SEGMENT.check1) // sparks move (slide option)
95459545
PartSys->sources[i].var = SEGMENT.intensity >> 3;
9546-
PartSys->sources[i].source.vx = speed; // update speed, do not change direction
9546+
PartSys->sources[i].source.vx = PartSys->sources[i].source.vx > 0 ? speed : -speed; // update speed, do not change direction
95479547
PartSys->sources[i].source.ttl = 400; // replenish its life (setting it perpetual uses more code)
95489548
PartSys->sources[i].sat = SEGMENT.custom1; // color saturation
95499549
PartSys->sources[i].size = SEGMENT.check3 ? 120 : 0;

0 commit comments

Comments
 (0)