1
0
mirror of https://github.com/excalidraw/excalidraw.git synced 2024-11-10 11:35:52 +01:00

fix: link popup position not accounting for offsets (#4695)

This commit is contained in:
David Luzar 2022-02-03 17:00:00 +01:00 committed by GitHub
parent f47ddb988f
commit de6371aac4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -197,12 +197,12 @@ const getCoordsForPopover = (
element: NonDeletedExcalidrawElement,
appState: AppState,
) => {
const { x: viewPortX, y: viewPortY } = sceneCoordsToViewportCoords(
const { x: viewportX, y: viewportY } = sceneCoordsToViewportCoords(
{ sceneX: element.x + element.width / 2, sceneY: element.y },
appState,
);
const x = viewPortX - CONTAINER_WIDTH / 2;
const y = viewPortY - SPACE_BOTTOM;
const x = viewportX - appState.offsetLeft - CONTAINER_WIDTH / 2;
const y = viewportY - appState.offsetTop - SPACE_BOTTOM;
return { x, y };
};