refactor: Use arrow function where possible (#3315)

This commit is contained in:
Lipis 2021-03-29 17:09:20 +03:00 committed by GitHub
parent bb568a9670
commit 722e5ca845
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 24 additions and 26 deletions

View file

@ -349,12 +349,12 @@ const generateElementShape = (
if (element.type === "arrow") {
const { startArrowhead = null, endArrowhead = "arrow" } = element;
function getArrowheadShapes(
const getArrowheadShapes = (
element: ExcalidrawLinearElement,
shape: Drawable[],
position: "start" | "end",
arrowhead: Arrowhead,
) {
) => {
const arrowheadPoints = getArrowheadPoints(
element,
shape,
@ -392,7 +392,7 @@ const generateElementShape = (
generator.line(x3, y3, x2, y2, options),
generator.line(x4, y4, x2, y2, options),
];
}
};
if (startArrowhead !== null) {
const shapes = getArrowheadShapes(