Fixed random_matrix effect.

This commit is contained in:
Fabian Schlenz 2019-10-10 06:43:01 +02:00
parent 205a0df842
commit 6b4f75b8bc
2 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@
class MatrixEffectColumn { class MatrixEffectColumn {
protected: protected:
Window* window; Window* window;
accum88 x, y; saccum78 x, y;
uint8_t length = 1; uint8_t length = 1;
uint8_t _direction = 2; uint8_t _direction = 2;
bool _random_direction = false; bool _random_direction = false;

View File

@ -47,7 +47,7 @@ void MatrixEffectColumn::advance(uint16_t ms) {
switch(_direction) { switch(_direction) {
case DIR_NORTH: case DIR_NORTH:
y-=speed * ms; y-=speed * ms;
if ((y>>8) > window->height && (y>>8) + length > window->height) running=false; if ((y>>8) + length < 0) running=false;
break; break;
case DIR_EAST: case DIR_EAST:
x+=speed * ms; x+=speed * ms;
@ -59,7 +59,7 @@ void MatrixEffectColumn::advance(uint16_t ms) {
break; break;
case DIR_WEST: case DIR_WEST:
x-=speed * ms; x-=speed * ms;
if ((x>>8) > window->width && (y>>8) + length > window->width) running=false; if ((x>>8) + length < 0) running=false;
break; break;
} }
} }