Sample the blank canvas away from the artboard center snap guide

This commit is contained in:
Codex committed 2026-11-30 16:54:54 +01:00
1 parent a6597610f1
commit 9f088b17f8
1 file changed
+3 -3
+3 -3
View File
@@ -40,8 +40,8 @@ with connection, connection.makefile("rwb") as stream:
assert window["focused"] and window["shell"] == "xdg_shell", window
a, b, width, height = view["canvasRect"]
extent = window["rect"]
x = round(extent["x"] + (a + width/2)*extent["width"]/view["window"][0])
y = round(extent["y"] + (b + height/2)*extent["height"]/view["window"][1])
x = round(extent["x"] + (a + width*0.43)*extent["width"]/view["window"][0])
y = round(extent["y"] + (b + height*0.39)*extent["height"]/view["window"][1])
pointer_process = subprocess.Popen([os.environ["RUNNER_TEMP"]+"/test-pointer",str(x),str(y),"1600","1000"], stdin=subprocess.PIPE)
time.sleep(1)
for filename, extra in [("without",[]),("with",["-c"])]:
@@ -57,7 +57,7 @@ with connection, connection.makefile("rwb") as stream:
if bounds is None:
away = Image.open(directory/"away.png").convert("RGB")
bounds = ImageChops.difference(shown.crop(area),away.crop(area)).getbbox()
print("Pointer is painted by the application", flush=True)
print("Compared canvas pixels before and after moving the pointer", flush=True)
assert bounds, ("moving the seat pointer changed no pixels", x, y, view["canvasRect"], subprocess.check_output(["swaymsg","-rt","get_seats"]).decode())
pointer = shown.crop(area).crop(bounds)
pointer.resize((pointer.width*8,pointer.height*8),Image.Resampling.NEAREST).save(directory/"nib.png")