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:
parent
f47ddb988f
commit
de6371aac4
@ -197,12 +197,12 @@ const getCoordsForPopover = (
|
|||||||
element: NonDeletedExcalidrawElement,
|
element: NonDeletedExcalidrawElement,
|
||||||
appState: AppState,
|
appState: AppState,
|
||||||
) => {
|
) => {
|
||||||
const { x: viewPortX, y: viewPortY } = sceneCoordsToViewportCoords(
|
const { x: viewportX, y: viewportY } = sceneCoordsToViewportCoords(
|
||||||
{ sceneX: element.x + element.width / 2, sceneY: element.y },
|
{ sceneX: element.x + element.width / 2, sceneY: element.y },
|
||||||
appState,
|
appState,
|
||||||
);
|
);
|
||||||
const x = viewPortX - CONTAINER_WIDTH / 2;
|
const x = viewportX - appState.offsetLeft - CONTAINER_WIDTH / 2;
|
||||||
const y = viewPortY - SPACE_BOTTOM;
|
const y = viewportY - appState.offsetTop - SPACE_BOTTOM;
|
||||||
return { x, y };
|
return { x, y };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user