do not disable polygon when creating new points via alt
This commit is contained in:
parent
d0be24bd6a
commit
904c209f96
@ -950,9 +950,7 @@ export class LinearElementEditor {
|
|||||||
|
|
||||||
if (!event.altKey) {
|
if (!event.altKey) {
|
||||||
if (lastPoint === lastUncommittedPoint) {
|
if (lastPoint === lastUncommittedPoint) {
|
||||||
LinearElementEditor.deletePoints(element, app.scene, [
|
LinearElementEditor.deletePoints(element, app, [points.length - 1]);
|
||||||
points.length - 1,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
...appState.editingLinearElement,
|
...appState.editingLinearElement,
|
||||||
@ -1248,16 +1246,19 @@ export class LinearElementEditor {
|
|||||||
|
|
||||||
static deletePoints(
|
static deletePoints(
|
||||||
element: NonDeleted<ExcalidrawLinearElement>,
|
element: NonDeleted<ExcalidrawLinearElement>,
|
||||||
scene: Scene,
|
app: AppClassProperties,
|
||||||
pointIndices: readonly number[],
|
pointIndices: readonly number[],
|
||||||
) {
|
) {
|
||||||
// Handle loop lock behavior
|
// Handle loop lock behavior
|
||||||
if (isLineElement(element) && element.loopLock) {
|
if (isLineElement(element) && element.loopLock) {
|
||||||
if (
|
if (
|
||||||
pointIndices.includes(0) ||
|
pointIndices.includes(0) ||
|
||||||
pointIndices.includes(element.points.length - 1)
|
(pointIndices.includes(element.points.length - 1) &&
|
||||||
|
// don't disable polygon if cleaning up uncommitted point
|
||||||
|
app.state.editingLinearElement?.lastUncommittedPoint !==
|
||||||
|
element.points[element.points.length - 1])
|
||||||
) {
|
) {
|
||||||
scene.mutateElement(element, { loopLock: false });
|
app.scene.mutateElement(element, { loopLock: false });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1291,7 +1292,7 @@ export class LinearElementEditor {
|
|||||||
|
|
||||||
LinearElementEditor._updatePoints(
|
LinearElementEditor._updatePoints(
|
||||||
element,
|
element,
|
||||||
scene,
|
app.scene,
|
||||||
nextPoints,
|
nextPoints,
|
||||||
offsetX,
|
offsetX,
|
||||||
offsetY,
|
offsetY,
|
||||||
|
|||||||
@ -257,11 +257,7 @@ export const actionDeleteSelected = register({
|
|||||||
: endBindingElement,
|
: endBindingElement,
|
||||||
};
|
};
|
||||||
|
|
||||||
LinearElementEditor.deletePoints(
|
LinearElementEditor.deletePoints(element, app, selectedPointsIndices);
|
||||||
element,
|
|
||||||
app.scene,
|
|
||||||
selectedPointsIndices,
|
|
||||||
);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
elements,
|
elements,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user