🐛 Fix eyedropper not taking into account changes in dpr

This commit is contained in:
Belén Albeza 2026-06-19 13:16:49 +02:00 committed by GitHub
parent b91eece5bf
commit c4115a6143
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -261,10 +261,11 @@
"Maps client (viewport) coordinates to device-pixel canvas coordinates."
[viewport-node client-x client-y]
(let [{brx :left bry :top} (dom/get-bounding-rect viewport-node)
dpr (wasm.api/get-dpr)
x (mth/floor (- client-x brx))
y (mth/floor (- client-y bry))]
[(mth/floor (* x wasm.api/dpr))
(mth/floor (* y wasm.api/dpr))]))
[(mth/floor (* x dpr))
(mth/floor (* y dpr))]))
(defn process-pointer-move-wasm
"Updates the magnifier loupe with the canvas region under the cursor. The