mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-08-26 11:47:00 +02:00
fix: Linear elements
This commit is contained in:
@@ -6,7 +6,6 @@ import {
|
|||||||
isValidPolygon,
|
isValidPolygon,
|
||||||
LinearElementEditor,
|
LinearElementEditor,
|
||||||
newElementWith,
|
newElementWith,
|
||||||
getHoveredElementForBinding,
|
|
||||||
} from "@excalidraw/element";
|
} from "@excalidraw/element";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -229,21 +228,10 @@ export const actionFinalize = register<FormData>({
|
|||||||
element.type !== "freedraw" &&
|
element.type !== "freedraw" &&
|
||||||
appState.lastPointerDownWith !== "touch"
|
appState.lastPointerDownWith !== "touch"
|
||||||
) {
|
) {
|
||||||
const { x: rx, y: ry, points, lastCommittedPoint } = element;
|
const { points, lastCommittedPoint } = element;
|
||||||
const lastGlobalPoint = pointFrom<GlobalPoint>(
|
|
||||||
rx + points[points.length - 1][0],
|
|
||||||
ry + points[points.length - 1][1],
|
|
||||||
);
|
|
||||||
const hoveredElementForBinding = getHoveredElementForBinding(
|
|
||||||
lastGlobalPoint,
|
|
||||||
app.scene.getNonDeletedElements(),
|
|
||||||
elementsMap,
|
|
||||||
app.state.zoom,
|
|
||||||
);
|
|
||||||
if (
|
if (
|
||||||
!hoveredElementForBinding &&
|
!lastCommittedPoint ||
|
||||||
(!lastCommittedPoint ||
|
points[points.length - 1] !== lastCommittedPoint
|
||||||
points[points.length - 1] !== lastCommittedPoint)
|
|
||||||
) {
|
) {
|
||||||
scene.mutateElement(element, {
|
scene.mutateElement(element, {
|
||||||
points: element.points.slice(0, -1),
|
points: element.points.slice(0, -1),
|
||||||
|
@@ -7975,7 +7975,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
|
|
||||||
// clicking inside commit zone → finalize arrow
|
// clicking inside commit zone → finalize arrow
|
||||||
if (
|
if (
|
||||||
hoveredElementForBinding ||
|
(isBindingElement(multiElement) && hoveredElementForBinding) ||
|
||||||
(multiElement.points.length > 1 &&
|
(multiElement.points.length > 1 &&
|
||||||
lastCommittedPoint &&
|
lastCommittedPoint &&
|
||||||
pointDistance(
|
pointDistance(
|
||||||
|
Reference in New Issue
Block a user