mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Prefer arrow functions (#2344)
This commit is contained in:
parent
e05acd6fd9
commit
a20f3240fd
19 changed files with 304 additions and 336 deletions
|
@ -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: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue