draw: less verbose

This commit is contained in:
Thomas Farstrike
2025-05-12 00:29:21 +02:00
parent 6a12af12de
commit fc12d9e35a
2 changed files with 4 additions and 3 deletions
+3
View File
@@ -19,3 +19,6 @@ conf.json*
# auto created when running on desktop:
internal_filesystem/SDLPointer_2
# config files etc:
internal_filesystem/data
@@ -147,10 +147,8 @@ def touch_cb(event):
for dy in range(-radius, radius):
if dx * dx + dy * dy <= square:
newx, newy = x + dx, y + dy
if 0 <= newx <= hor_res and 0 <= newy <= ver_res:
if 0 <= newx <= hor_res and 0 <= newy <= ver_res: # don't draw outside of canvas because that may crash
canvas.set_px(x + dx, y + dy, DARKPINK, lv.OPA.COVER)
else:
print(f"Not drawing outside of canvas at {newx},{newy} because that crashes.")
canvas = lv.canvas(appscreen)