Skip to content

Commit fc12d9e

Browse files
draw: less verbose
1 parent 6a12af1 commit fc12d9e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ conf.json*
1919

2020
# auto created when running on desktop:
2121
internal_filesystem/SDLPointer_2
22+
23+
# config files etc:
24+
internal_filesystem/data

internal_filesystem/apps/com.example.draw/assets/draw.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,8 @@ def touch_cb(event):
147147
for dy in range(-radius, radius):
148148
if dx * dx + dy * dy <= square:
149149
newx, newy = x + dx, y + dy
150-
if 0 <= newx <= hor_res and 0 <= newy <= ver_res:
150+
if 0 <= newx <= hor_res and 0 <= newy <= ver_res: # don't draw outside of canvas because that may crash
151151
canvas.set_px(x + dx, y + dy, DARKPINK, lv.OPA.COVER)
152-
else:
153-
print(f"Not drawing outside of canvas at {newx},{newy} because that crashes.")
154152

155153

156154
canvas = lv.canvas(appscreen)

0 commit comments

Comments
 (0)