auto-enable polygon when aligning start/end points
This commit is contained in:
parent
904c209f96
commit
b3eb93f130
@ -63,6 +63,7 @@ import {
|
|||||||
getControlPointsForBezierCurve,
|
getControlPointsForBezierCurve,
|
||||||
mapIntervalToBezierT,
|
mapIntervalToBezierT,
|
||||||
getBezierXY,
|
getBezierXY,
|
||||||
|
toggleLinePolygonState,
|
||||||
} from "./shapes";
|
} from "./shapes";
|
||||||
|
|
||||||
import { getLockedLinearCursorAlignSize } from "./sizeHelpers";
|
import { getLockedLinearCursorAlignSize } from "./sizeHelpers";
|
||||||
@ -453,6 +454,18 @@ export class LinearElementEditor {
|
|||||||
selectedPoint === element.points.length - 1
|
selectedPoint === element.points.length - 1
|
||||||
) {
|
) {
|
||||||
if (isPathALoop(element.points, appState.zoom.value)) {
|
if (isPathALoop(element.points, appState.zoom.value)) {
|
||||||
|
if (isLineElement(element)) {
|
||||||
|
scene.mutateElement(
|
||||||
|
element,
|
||||||
|
{
|
||||||
|
...toggleLinePolygonState(element, true),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
informMutation: false,
|
||||||
|
isDragging: false,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
LinearElementEditor.movePoints(element, scene, [
|
LinearElementEditor.movePoints(element, scene, [
|
||||||
{
|
{
|
||||||
index: selectedPoint,
|
index: selectedPoint,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user