calculate coords based on container viewport position (#1955)
* feat: calculate coords based on parent left and top so it renders correctly in host App * fix text * move offsets to state & fix bugs * fix text jumping * account for zoom in textWysiwyg & undo incorrect offsetting Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
@ -135,7 +135,7 @@ export const actionLoadScene = register({
|
||||
commitToHistory: false,
|
||||
};
|
||||
},
|
||||
PanelComponent: ({ updateData }) => (
|
||||
PanelComponent: ({ updateData, appState }) => (
|
||||
<ToolButton
|
||||
type="button"
|
||||
icon={load}
|
||||
@ -143,7 +143,7 @@ export const actionLoadScene = register({
|
||||
aria-label={t("buttons.load")}
|
||||
showAriaLabel={useIsMobile()}
|
||||
onClick={() => {
|
||||
loadFromJSON()
|
||||
loadFromJSON(appState)
|
||||
.then(({ elements, appState }) => {
|
||||
updateData({ elements: elements, appState: appState });
|
||||
})
|
||||
|
@ -6,7 +6,7 @@ import { AppState } from "../types";
|
||||
export type ActionResult =
|
||||
| {
|
||||
elements?: readonly ExcalidrawElement[] | null;
|
||||
appState?: AppState | null;
|
||||
appState?: MarkOptional<AppState, "offsetTop" | "offsetLeft"> | null;
|
||||
commitToHistory: boolean;
|
||||
syncHistory?: boolean;
|
||||
}
|
||||
|
Reference in New Issue
Block a user