From ca24eed1acb958b2ef8c4b94278c971aea053412 Mon Sep 17 00:00:00 2001 From: Abdo Date: Mon, 8 Apr 2024 18:40:22 +0300 Subject: [PATCH] Fix IO mask position slightly off in edit mode (#3121) (cherry picked from commit 642f29cf5e8b07a4bc829ae2bc57f2efe7503b47) --- ts/image-occlusion/tools/from-shapes.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ts/image-occlusion/tools/from-shapes.ts b/ts/image-occlusion/tools/from-shapes.ts index 61fa00c2f..4bdf0cfcd 100644 --- a/ts/image-occlusion/tools/from-shapes.ts +++ b/ts/image-occlusion/tools/from-shapes.ts @@ -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); });