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