From 2b835ebb7803058da4972be6c19595b210690d59 Mon Sep 17 00:00:00 2001 From: zsviczian Date: Wed, 3 Jan 2024 16:08:22 +0100 Subject: [PATCH] Do not close loop for freedraw --- packages/excalidraw/element/linearElementEditor.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/excalidraw/element/linearElementEditor.ts b/packages/excalidraw/element/linearElementEditor.ts index bf64ee732..2902772a1 100644 --- a/packages/excalidraw/element/linearElementEditor.ts +++ b/packages/excalidraw/element/linearElementEditor.ts @@ -42,7 +42,7 @@ import { isBindingEnabled, } from "./binding"; import { tupleToCoors } from "../utils"; -import { isBindingElement } from "./typeChecks"; +import { isBindingElement, isFreeDrawElement } from "./typeChecks"; import { KEYS, shouldRotateWithDiscreteAngle } from "../keys"; import { getBoundTextElement, handleBindTextResize } from "./textElement"; import { DRAGGING_THRESHOLD } from "../constants"; @@ -344,7 +344,10 @@ export class LinearElementEditor { selectedPoint === 0 || selectedPoint === element.points.length - 1 ) { - if (isPathALoop(element.points, appState.zoom.value)) { + if ( + !isFreeDrawElement(element) && + isPathALoop(element.points, appState.zoom.value) + ) { LinearElementEditor.movePoints(element, [ { index: selectedPoint,