mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: Better legibility when editing some math elements.
This commit is contained in:
parent
089aaa8792
commit
b988f67759
3 changed files with 22 additions and 1 deletions
|
@ -44,6 +44,7 @@ import { actionZoomIn, actionZoomOut } from "../actions/actionCanvas";
|
|||
import App from "../components/App";
|
||||
import { LinearElementEditor } from "./linearElementEditor";
|
||||
import { parseClipboard } from "../clipboard";
|
||||
import { SubtypeMethods, getSubtypeMethods } from "../subtypes";
|
||||
|
||||
const getTransform = (
|
||||
offsetX: number,
|
||||
|
@ -99,6 +100,14 @@ export const getOriginalContainerHeightFromCache = (
|
|||
return originalContainerCache[id]?.height ?? null;
|
||||
};
|
||||
|
||||
const getEditorStyle = function (element) {
|
||||
const map = getSubtypeMethods(element.subtype);
|
||||
if (map?.getEditorStyle) {
|
||||
return map.getEditorStyle(element);
|
||||
}
|
||||
return {};
|
||||
} as SubtypeMethods["getEditorStyle"];
|
||||
|
||||
export const textWysiwyg = ({
|
||||
id,
|
||||
onChange,
|
||||
|
@ -395,6 +404,7 @@ export const textWysiwyg = ({
|
|||
whiteSpace,
|
||||
overflowWrap: "break-word",
|
||||
boxSizing: "content-box",
|
||||
...getEditorStyle(element),
|
||||
});
|
||||
updateWysiwygStyle();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue