You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
draw: less verbose
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user