Skip to content

Commit

Permalink
Refactor and fix bugs in position handling logic in initializePositio…
Browse files Browse the repository at this point in the history
…ns.py
  • Loading branch information
1Euro7Cent committed Oct 13, 2024
1 parent b563f8c commit 757d1fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions initializePositions.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ def onClick(x, y, button, pressed):
positions[name]["pen"]["x"] = x
positions[name]["pen"]["y"] = y

if clickToExpand:
status = "clickToExpand"
else:
status = "topleft"
# if clickToExpand:
# status = "clickToExpand"
# else:
status = "topleft"

# status = "topleft"
return
Expand All @@ -147,14 +147,15 @@ def onClick(x, y, button, pressed):
# print('click to close the color picker')
status = "clickToClose"
else:
status = "topleft"
status = "colors"
return

if status == "clickToClose":
positions[name]["clickToClose"]["x"] = x
positions[name]["clickToClose"]["y"] = y
# print('click to close the color picker')
status = "topleft"
# status = "topleft"
status = "skipClick"
return

if status == "topleft":
Expand All @@ -168,7 +169,9 @@ def onClick(x, y, button, pressed):
positions[name]["bottomright"]["y"] = y
if clickToExpand:
# print('click to expand the color picker to be able to click on all colors')
status = "skipClick"
# status = "skipClick"
status = "clickToExpand"

else:
status = "colors"

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Drawbot",
"version": "3.20.0",
"version": "3.20.1",
"description": "This moves the mouse to draw stuff",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 757d1fe

Please sign in to comment.