fix: test fix to normalized coordinate space.

This commit is contained in:
Zoe
2026-09-20 23:35:24 -05:00
parent f4aef8f5f3
commit 5ea5c9aeb1
5 changed files with 19 additions and 38 deletions
+3 -3
View File
@@ -26,9 +26,9 @@ def integer(value, low, high):
def click_pixels(action, width, height, space):
if space == "normalized_1000":
x = integer(action.get("x"), 0, 1000)
y = integer(action.get("y"), 0, 1000)
return (x * (width - 1) + 500) // 1000, (y * (height - 1) + 500) // 1000
x = (integer(action.get("x"), 0, 1000) * (width - 1) + 500) // 1000 if width > 1000 else integer(action.get("x"), 0, width - 1)
y = (integer(action.get("y"), 0, 1000) * (height - 1) + 500) // 1000 if height > 1000 else integer(action.get("y"), 0, height - 1)
return x, y
return integer(action.get("x"), 0, width - 1), integer(action.get("y"), 0, height - 1)