Skip to content

Commit cf64a8b

Browse files
committed
Update touchpaint_example.py
1 parent f59a57c commit cf64a8b

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

examples/touchpaint_example.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@
4141
color_palette[6] = 0xFF00FF
4242
color_palette[7] = 0xFFFFFF
4343

44-
tile_grid = displayio.TileGrid(
45-
bitmap,
46-
pixel_shader=color_palette
47-
48-
)
44+
tile_grid = displayio.TileGrid(bitmap, pixel_shader=color_palette)
4945
# tilegrid is flipped to align x, y with touch screen x, y
5046
tile_grid.flip_y = True
5147
tile_grid.flip_x = True
@@ -73,10 +69,7 @@
7369
x = t[0]
7470
y = t[1]
7571
print(x, y)
76-
if (
77-
not 0 <= x < display.width
78-
or not 0 <= y < display.height
79-
):
72+
if not 0 <= x < display.width or not 0 <= y < display.height:
8073
continue # Skip out of bounds touches
8174
if y < palette_width:
8275
current_color = bitmap[x, y]

0 commit comments

Comments
 (0)