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
@ -120,6 +120,7 @@ const pasteItem = (canvas: fabric.Canvas): void => {
|
||||
top: clonedObj.top + 10,
|
||||
evented: true,
|
||||
});
|
||||
disableRotation(clonedObj);
|
||||
|
||||
if (clonedObj.type === "activeSelection") {
|
||||
// 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) {
|
||||
canvas.remove(ellipse);
|
||||
ellipse = undefined;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -118,5 +119,6 @@ export const drawEllipse = (canvas: fabric.Canvas): void => {
|
||||
ellipse.setCoords();
|
||||
canvas.setActiveObject(ellipse);
|
||||
undoStack.onObjectAdded(ellipse.id);
|
||||
ellipse = undefined;
|
||||
});
|
||||
};
|
||||
|
@ -93,6 +93,7 @@ export const drawRectangle = (canvas: fabric.Canvas): void => {
|
||||
}
|
||||
if (rect.width < 5 || rect.height < 5) {
|
||||
canvas.remove(rect);
|
||||
rect = undefined;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -113,5 +114,6 @@ export const drawRectangle = (canvas: fabric.Canvas): void => {
|
||||
rect.setCoords();
|
||||
canvas.setActiveObject(rect);
|
||||
undoStack.onObjectAdded(rect.id);
|
||||
rect = undefined;
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user