Skip to content

Commit

Permalink
Update touchpaint_example.py
Browse files Browse the repository at this point in the history
  • Loading branch information
BlitzCityDIY committed Dec 8, 2023
1 parent f59a57c commit cf64a8b
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions examples/touchpaint_example.py
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit cf64a8b

Please sign in to comment.