mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
Fix shape selection malfunction after creating shapes in succession (#2773)
* Fix shape selection malfunction after creating shapes in succession * Disable rotation when duplicating a shape
This commit is contained in:
parent
0736cdb29c
commit
252addf611
3 changed files with 5 additions and 0 deletions
|
@ -120,6 +120,7 @@ const pasteItem = (canvas: fabric.Canvas): void => {
|
||||||
top: clonedObj.top + 10,
|
top: clonedObj.top + 10,
|
||||||
evented: true,
|
evented: true,
|
||||||
});
|
});
|
||||||
|
disableRotation(clonedObj);
|
||||||
|
|
||||||
if (clonedObj.type === "activeSelection") {
|
if (clonedObj.type === "activeSelection") {
|
||||||
// active selection needs a reference to the canvas.
|
// active selection needs a reference to the canvas.
|
||||||
|
|
|
@ -98,6 +98,7 @@ export const drawEllipse = (canvas: fabric.Canvas): void => {
|
||||||
}
|
}
|
||||||
if (ellipse.width < 5 || ellipse.height < 5) {
|
if (ellipse.width < 5 || ellipse.height < 5) {
|
||||||
canvas.remove(ellipse);
|
canvas.remove(ellipse);
|
||||||
|
ellipse = undefined;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,5 +119,6 @@ export const drawEllipse = (canvas: fabric.Canvas): void => {
|
||||||
ellipse.setCoords();
|
ellipse.setCoords();
|
||||||
canvas.setActiveObject(ellipse);
|
canvas.setActiveObject(ellipse);
|
||||||
undoStack.onObjectAdded(ellipse.id);
|
undoStack.onObjectAdded(ellipse.id);
|
||||||
|
ellipse = undefined;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -93,6 +93,7 @@ export const drawRectangle = (canvas: fabric.Canvas): void => {
|
||||||
}
|
}
|
||||||
if (rect.width < 5 || rect.height < 5) {
|
if (rect.width < 5 || rect.height < 5) {
|
||||||
canvas.remove(rect);
|
canvas.remove(rect);
|
||||||
|
rect = undefined;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,5 +114,6 @@ export const drawRectangle = (canvas: fabric.Canvas): void => {
|
||||||
rect.setCoords();
|
rect.setCoords();
|
||||||
canvas.setActiveObject(rect);
|
canvas.setActiveObject(rect);
|
||||||
undoStack.onObjectAdded(rect.id);
|
undoStack.onObjectAdded(rect.id);
|
||||||
|
rect = undefined;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue