From cb287f37e3a9b446cde3fb4876708cd7e903e586 Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 31 Jan 2017 15:48:46 +0000 Subject: [PATCH] Fix for out of bounds LED index in BlocksDrawing example --- examples/BLOCKS/BlocksDrawing/Source/LightpadComponent.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/BLOCKS/BlocksDrawing/Source/LightpadComponent.h b/examples/BLOCKS/BlocksDrawing/Source/LightpadComponent.h index dfce547230..51d1b41021 100644 --- a/examples/BLOCKS/BlocksDrawing/Source/LightpadComponent.h +++ b/examples/BLOCKS/BlocksDrawing/Source/LightpadComponent.h @@ -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); }