From cf64a8b7b78a7d21f64ac282f41a0b0cf22cccd0 Mon Sep 17 00:00:00 2001 From: Liz Date: Fri, 8 Dec 2023 13:24:02 -0500 Subject: [PATCH] Update touchpaint_example.py --- examples/touchpaint_example.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/examples/touchpaint_example.py b/examples/touchpaint_example.py index 13859f1..78bbbac 100644 --- a/examples/touchpaint_example.py +++ b/examples/touchpaint_example.py @@ -41,11 +41,7 @@ color_palette[6] = 0xFF00FF color_palette[7] = 0xFFFFFF -tile_grid = displayio.TileGrid( - bitmap, - pixel_shader=color_palette - -) +tile_grid = displayio.TileGrid(bitmap, pixel_shader=color_palette) # tilegrid is flipped to align x, y with touch screen x, y tile_grid.flip_y = True tile_grid.flip_x = True @@ -73,10 +69,7 @@ x = t[0] y = t[1] print(x, y) - if ( - not 0 <= x < display.width - or not 0 <= y < display.height - ): + if not 0 <= x < display.width or not 0 <= y < display.height: continue # Skip out of bounds touches if y < palette_width: current_color = bitmap[x, y]