Fix in is2D()

Vertical & horizontal 1D segment (on 2D matrix)
Index overshooting fix.
This commit is contained in:
Blaž Kristan
2022-08-22 14:08:45 +02:00
parent cf0f0d77be
commit e14c5bbd25
3 changed files with 19 additions and 6 deletions

View File

@@ -150,6 +150,7 @@ uint16_t IRAM_ATTR Segment::XY(uint16_t x, uint16_t y) {
void IRAM_ATTR Segment::setPixelColorXY(int x, int y, uint32_t col)
{
if (!strip.isMatrix) return; // not a matrix set-up
if (x >= virtualWidth() || y >= virtualHeight()) return; // if pixel would fall out of virtual segment just exit
if (leds) leds[XY(x,y)] = col;