magicOffset only for Firefox and Safari

This commit is contained in:
zsviczian 2023-03-06 23:45:11 +01:00
parent 956228f4a1
commit 1a877fa8c7

View File

@ -11,7 +11,7 @@ import {
isBoundToContainer,
isTextElement,
} from "./typeChecks";
import { CLASSES, VERTICAL_ALIGN } from "../constants";
import { CLASSES, isFirefox, isSafari, VERTICAL_ALIGN } from "../constants";
import {
ExcalidrawElement,
ExcalidrawLinearElement,
@ -348,9 +348,11 @@ export const textWysiwyg = ({
});
const magicOffset =
(excalidrawContainer
isFirefox || isSafari
? (excalidrawContainer
? parseFloat(getComputedStyle(excalidrawContainer).fontSize)
: 16) / 8;
: 16) / 16
: 0;
const onEditableInput = () => {
const updatedTextElement = Scene.getScene(element)?.getElement(