mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
use latest linear
This commit is contained in:
parent
900ee41d0f
commit
7d5f5b3c62
1 changed files with 11 additions and 4 deletions
|
@ -2,7 +2,12 @@ import { type ReactNode, useEffect, useMemo, useRef, useState } from "react";
|
||||||
|
|
||||||
import { updateElbowArrowPoints } from "@excalidraw/element/elbowArrow";
|
import { updateElbowArrowPoints } from "@excalidraw/element/elbowArrow";
|
||||||
|
|
||||||
import { pointFrom, pointRotateRads, type LocalPoint } from "@excalidraw/math";
|
import {
|
||||||
|
pointDistance,
|
||||||
|
pointFrom,
|
||||||
|
pointRotateRads,
|
||||||
|
type LocalPoint,
|
||||||
|
} from "@excalidraw/math";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
isArrowElement,
|
isArrowElement,
|
||||||
|
@ -607,14 +612,16 @@ export const switchShapes = (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const firstElement = selectedLinearSwitchableElements[0];
|
const convertedSelectedLinearElements = getLinearSwitchableElements(
|
||||||
|
app.scene.getSelectedElements(app.state),
|
||||||
|
);
|
||||||
|
|
||||||
app.setState((prevState) => ({
|
app.setState((prevState) => ({
|
||||||
selectedElementIds,
|
selectedElementIds,
|
||||||
selectedLinearElement:
|
selectedLinearElement:
|
||||||
selectedLinearSwitchableElements.length === 1
|
convertedSelectedLinearElements.length === 1
|
||||||
? new LinearElementEditor(
|
? new LinearElementEditor(
|
||||||
firstElement as ExcalidrawLinearElement,
|
convertedSelectedLinearElements[0],
|
||||||
app.scene.getNonDeletedElementsMap(),
|
app.scene.getNonDeletedElementsMap(),
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue