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:
@ -237,7 +237,7 @@ export const importFromBackend = async (
|
||||
privateKey: string | undefined,
|
||||
) => {
|
||||
let elements: readonly ExcalidrawElement[] = [];
|
||||
let appState: AppState = getDefaultAppState();
|
||||
let appState = getDefaultAppState();
|
||||
|
||||
try {
|
||||
const response = await fetch(
|
||||
@ -245,7 +245,7 @@ export const importFromBackend = async (
|
||||
);
|
||||
if (!response.ok) {
|
||||
window.alert(t("alerts.importBackendFailed"));
|
||||
return restore(elements, appState, { scrollToContent: true });
|
||||
return restore(elements, appState);
|
||||
}
|
||||
let data;
|
||||
if (privateKey) {
|
||||
@ -276,7 +276,7 @@ export const importFromBackend = async (
|
||||
window.alert(t("alerts.importBackendFailed"));
|
||||
console.error(error);
|
||||
} finally {
|
||||
return restore(elements, appState, { scrollToContent: true });
|
||||
return restore(elements, appState);
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user