Prefer arrow functions (#2344)
This commit is contained in:
@ -82,7 +82,7 @@ export const newElement = (
|
||||
_newElementBase<ExcalidrawGenericElement>(opts.type, opts);
|
||||
|
||||
/** computes element x/y offset based on textAlign/verticalAlign */
|
||||
function getTextElementPositionOffsets(
|
||||
const getTextElementPositionOffsets = (
|
||||
opts: {
|
||||
textAlign: ExcalidrawTextElement["textAlign"];
|
||||
verticalAlign: ExcalidrawTextElement["verticalAlign"];
|
||||
@ -91,7 +91,7 @@ function getTextElementPositionOffsets(
|
||||
width: number;
|
||||
height: number;
|
||||
},
|
||||
) {
|
||||
) => {
|
||||
return {
|
||||
x:
|
||||
opts.textAlign === "center"
|
||||
@ -101,7 +101,7 @@ function getTextElementPositionOffsets(
|
||||
: 0,
|
||||
y: opts.verticalAlign === "middle" ? metrics.height / 2 : 0,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export const newTextElement = (
|
||||
opts: {
|
||||
|
@ -46,7 +46,7 @@ export const textWysiwyg = ({
|
||||
getViewportCoords: (x: number, y: number) => [number, number];
|
||||
element: ExcalidrawElement;
|
||||
}) => {
|
||||
function updateWysiwygStyle() {
|
||||
const updateWysiwygStyle = () => {
|
||||
const updatedElement = Scene.getScene(element)?.getElement(id);
|
||||
if (updatedElement && isTextElement(updatedElement)) {
|
||||
const [viewportX, viewportY] = getViewportCoords(
|
||||
@ -80,7 +80,7 @@ export const textWysiwyg = ({
|
||||
filter: "var(--appearance-filter)",
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const editable = document.createElement("textarea");
|
||||
|
||||
|
Reference in New Issue
Block a user