mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Aligns arrowhead schemas (#2517)
This commit is contained in:
parent
9cf54041dc
commit
9cfe7b45e5
5 changed files with 156 additions and 287 deletions
|
@ -2578,12 +2578,16 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||
elementType === "draw" ? null : this.state.gridSize,
|
||||
);
|
||||
|
||||
// If arrow is pre-arrowheads, it will have undefined for both start and end arrowheads.
|
||||
// If so, we want it to be null/"arrow". If the linear item is not an arrow, we want it
|
||||
// to be null/null. Otherwise, we want it to use the currentItemArrowheads values.
|
||||
const { start, end } = this.state.currentItemArrowheads;
|
||||
/* If arrow is pre-arrowheads, it will have undefined for both start and end arrowheads.
|
||||
If so, we want it to be null for start and "arrow" for end. If the linear item is not
|
||||
an arrow, we want it to be null for both. Otherwise, we want it to use the
|
||||
values from appState. */
|
||||
|
||||
const { currentItemStartArrowhead, currentItemEndArrowhead } = this.state;
|
||||
const [startArrowhead, endArrowhead] =
|
||||
elementType === "arrow" ? [start, end] : [null, null];
|
||||
elementType === "arrow"
|
||||
? [currentItemStartArrowhead, currentItemEndArrowhead]
|
||||
: [null, null];
|
||||
|
||||
const element = newLinearElement({
|
||||
type: elementType,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue