mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Move path related function into the math package
This commit is contained in:
parent
1b56cf90fb
commit
9eb08df3ea
9 changed files with 72 additions and 46 deletions
|
@ -15,8 +15,7 @@ import { isBindingElement, isLinearElement } from "../element/typeChecks";
|
|||
import type { AppState } from "../types";
|
||||
import { resetCursor } from "../cursor";
|
||||
import { StoreAction } from "../store";
|
||||
import { point } from "../../math";
|
||||
import { isPathALoop } from "../shapes";
|
||||
import { pathIsALoop, point } from "../../math";
|
||||
|
||||
export const actionFinalize = register({
|
||||
name: "finalize",
|
||||
|
@ -104,7 +103,7 @@ export const actionFinalize = register({
|
|||
// If the multi point line closes the loop,
|
||||
// set the last point to first point.
|
||||
// This ensures that loop remains closed at different scales.
|
||||
const isLoop = isPathALoop(multiPointElement.points, appState.zoom.value);
|
||||
const isLoop = pathIsALoop(multiPointElement.points, appState.zoom.value);
|
||||
if (
|
||||
multiPointElement.type === "line" ||
|
||||
multiPointElement.type === "freedraw"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue