mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
fix: eye dropper not accounting for offsets (#6640)
This commit is contained in:
parent
079aa72475
commit
a065ec67a9
1 changed files with 4 additions and 2 deletions
|
@ -77,8 +77,8 @@ export const EyeDropper: React.FC<{
|
||||||
colorPreviewDiv.style.left = `${clientX + 20}px`;
|
colorPreviewDiv.style.left = `${clientX + 20}px`;
|
||||||
|
|
||||||
const pixel = ctx.getImageData(
|
const pixel = ctx.getImageData(
|
||||||
clientX * window.devicePixelRatio,
|
clientX * window.devicePixelRatio - appState.offsetLeft,
|
||||||
clientY * window.devicePixelRatio,
|
clientY * window.devicePixelRatio - appState.offsetTop,
|
||||||
1,
|
1,
|
||||||
1,
|
1,
|
||||||
).data;
|
).data;
|
||||||
|
@ -182,6 +182,8 @@ export const EyeDropper: React.FC<{
|
||||||
swapPreviewOnAlt,
|
swapPreviewOnAlt,
|
||||||
previewType,
|
previewType,
|
||||||
excalidrawContainer,
|
excalidrawContainer,
|
||||||
|
appState.offsetLeft,
|
||||||
|
appState.offsetTop,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const ref = useRef<HTMLDivElement>(null);
|
const ref = useRef<HTMLDivElement>(null);
|
||||||
|
|
Loading…
Add table
Reference in a new issue