Browse Source

Fix for out of bounds LED index in BlocksDrawing example

tags/2021-05-28
ed 8 years ago
parent
commit
cb287f37e3
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      examples/BLOCKS/BlocksDrawing/Source/LightpadComponent.h

+ 2
- 1
examples/BLOCKS/BlocksDrawing/Source/LightpadComponent.h View File

@@ -108,7 +108,8 @@ public:
/** Sets the colour of one of the LEDComponents */
void setLEDColour (int x, int y, Colour c)
{
jassert (isPositiveAndBelow (x, 15) && isPositiveAndBelow (y, 15));
x = jmin (x, 14);
y = jmin (y, 14);
leds.getUnchecked ((x * 15) + y)->setColour (c);
}


Loading…
Cancel
Save