Browse Source

fix: eye-dropper not working with app offset correctly on non-1 dPR (#6835)

pull/6837/head
David Luzar 2 years ago committed by GitHub
parent
commit
fc9a9a2571
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/components/EyeDropper.tsx

4
src/components/EyeDropper.tsx

@ -77,8 +77,8 @@ export const EyeDropper: React.FC<{ @@ -77,8 +77,8 @@ export const EyeDropper: React.FC<{
colorPreviewDiv.style.left = `${clientX + 20}px`;
const pixel = ctx.getImageData(
clientX * window.devicePixelRatio - appState.offsetLeft,
clientY * window.devicePixelRatio - appState.offsetTop,
(clientX - appState.offsetLeft) * window.devicePixelRatio,
(clientY - appState.offsetTop) * window.devicePixelRatio,
1,
1,
).data;

Loading…
Cancel
Save