Update textWysiwyg.tsx

This commit is contained in:
zsviczian 2023-03-07 09:54:50 +01:00 committed by GitHub
parent 6035ebe95f
commit 340b9757c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,7 +11,7 @@ import {
isBoundToContainer, isBoundToContainer,
isTextElement, isTextElement,
} from "./typeChecks"; } from "./typeChecks";
import { CLASSES, isFirefox, isSafari, VERTICAL_ALIGN } from "../constants"; import { CLASSES, VERTICAL_ALIGN } from "../constants";
import { import {
ExcalidrawElement, ExcalidrawElement,
ExcalidrawLinearElement, ExcalidrawLinearElement,
@ -347,13 +347,10 @@ export const textWysiwyg = ({
boxSizing: "content-box", boxSizing: "content-box",
}); });
//As Firefox, Safari needs little higher dimensions on DOM
const magicOffset = const magicOffset =
isFirefox || isSafari (excalidrawContainer
? (excalidrawContainer ? parseFloat(getComputedStyle(excalidrawContainer).fontSize)
? parseFloat(getComputedStyle(excalidrawContainer).fontSize) : 16) / 16;
: 16) / 16
: 0;
const onEditableInput = () => { const onEditableInput = () => {
const updatedTextElement = Scene.getScene(element)?.getElement( const updatedTextElement = Scene.getScene(element)?.getElement(