Fix IO mask position slightly off in edit mode (#3121)

(cherry picked from commit 642f29cf5e)
This commit is contained in:
Abdo 2024-04-08 18:40:22 +03:00 committed by Damien Elmes
parent 4daf293d91
commit ca24eed1ac

View file

@ -11,7 +11,7 @@ export const addShape = (
boundingBox: fabric.Rect,
shape: Shape,
): void => {
const fabricShape = shape.toFabric(boundingBox);
const fabricShape = shape.toFabric(boundingBox.getBoundingRect(true));
addBorder(fabricShape);
if (fabricShape.type === "i-text") {
enableUniformScaling(canvas, fabricShape);
@ -26,7 +26,7 @@ export const addShapeGroup = (
): void => {
const group = new fabric.Group();
shapes.map((shape) => {
const fabricShape = shape.toFabric(boundingBox);
const fabricShape = shape.toFabric(boundingBox.getBoundingRect(true));
addBorder(fabricShape);
group.addWithUpdate(fabricShape);
});