Skip to content

Commit aba736c

Browse files
committed
moved modulo
1 parent bdec873 commit aba736c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

wled00/FX.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7472,7 +7472,7 @@ static const char _data_FX_MODE_2DDISTORTIONWAVES[] PROGMEM = "Distortion Waves@
74727472
static void soapPixels(bool isRow, uint8_t *noise3d, CRGB *pixels) {
74737473
const int cols = SEG_W;
74747474
const int rows = SEG_H;
7475-
const auto XY = [&](int x, int y) { return (x%cols) + (y%rows) * cols; };
7475+
const auto XY = [&](int x, int y) { return x + y * cols; };
74767476
const auto abs = [](int x) { return x<0 ? -x : x; };
74777477
const int tRC = isRow ? rows : cols; // transpose if isRow
74787478
const int tCR = isRow ? cols : rows; // transpose if isRow
@@ -7494,8 +7494,8 @@ static void soapPixels(bool isRow, uint8_t *noise3d, CRGB *pixels) {
74947494
zD = j + delta;
74957495
zF = zD + 1;
74967496
}
7497-
int yA = abs(zD);
7498-
int yB = abs(zF);
7497+
int yA = abs(zD)%tCR;
7498+
int yB = abs(zF)%tCR;
74997499
int xA = i;
75007500
int xB = i;
75017501
if (isRow) {

0 commit comments

Comments
 (0)