feat: add triangle arrowhead (#4024)

Co-authored-by: ad1992 <aakansha1216@gmail.com>
Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
Jonas Bleyl
2021-10-27 18:27:39 +01:00
committed by GitHub
parent d89fb3371b
commit 8d8769ba4e
7 changed files with 60 additions and 2 deletions

View File

@ -258,6 +258,7 @@ export const getArrowheadPoints = (
arrow: 30,
bar: 15,
dot: 15,
triangle: 15,
}[arrowhead]; // pixels (will differ for each arrowhead)
let length = 0;
@ -294,6 +295,7 @@ export const getArrowheadPoints = (
const angle = {
arrow: 20,
bar: 90,
triangle: 25,
}[arrowhead]; // degrees
// Return points

View File

@ -129,7 +129,7 @@ export type PointBinding = {
gap: number;
};
export type Arrowhead = "arrow" | "bar" | "dot";
export type Arrowhead = "arrow" | "bar" | "dot" | "triangle";
export type ExcalidrawLinearElement = _ExcalidrawElementBase &
Readonly<{