|
@@ -102,9 +102,11 @@ export const textWysiwyg = ({
|
|
|
|
|
|
const updateWysiwygStyle = () => {
|
|
|
const appState = app.state;
|
|
|
- const updatedElement = Scene.getScene(element)?.getElement(
|
|
|
- id,
|
|
|
- ) as ExcalidrawTextElement;
|
|
|
+ const updatedElement =
|
|
|
+ Scene.getScene(element)?.getElement<ExcalidrawTextElement>(id);
|
|
|
+ if (!updatedElement) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
const { textAlign, verticalAlign } = updatedElement;
|
|
|
|
|
|
const approxLineHeight = getApproxLineHeight(getFontString(updatedElement));
|