From 89ff652313cfc198307bd27e17d14afa3f9bae29 Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Fri, 28 Jun 2024 14:54:58 +0300 Subject: [PATCH 1/2] fix(): ClippingGroup size Revert "fix(): ClippingGroup size (#29)" This reverts commit 48747a9cc78af4b094240fb53f1348d0dad8c766. --- packages/fabric/src/EraserBrush.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/fabric/src/EraserBrush.ts b/packages/fabric/src/EraserBrush.ts index 3f14186..466ffea 100644 --- a/packages/fabric/src/EraserBrush.ts +++ b/packages/fabric/src/EraserBrush.ts @@ -40,15 +40,15 @@ const assertClippingGroup = (object: fabric.FabricObject) => { return curr; } - // In order to support objects with stroke width, stroke uniform, shadow etc. - // we use the actual drawn size - const { width, height } = object._limitCacheSize( - object._getCacheCanvasDimensions() - ); + const strokeWidth = object.strokeWidth; + const strokeWidthFactor = new fabric.Point(strokeWidth, strokeWidth); + const strokeVector = object.strokeUniform + ? strokeWidthFactor.divide(object.getObjectScaling()) + : strokeWidthFactor; const next = new ClippingGroup([], { - width, - height, + width: object.width + strokeVector.x, + height: object.height + strokeVector.y, }); if (curr) { From 7cca0da775514fec2bac0b41d12b6ae2add7cbff Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Fri, 28 Jun 2024 15:02:36 +0300 Subject: [PATCH 2/2] 1.1.6 --- README.md | 1 + package-lock.json | 2 +- packages/fabric/package.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 727011e..1ee0a41 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ npm init -w ./packages/a ## Publish ```bash +npm run prepublish npm -w @erase2d/fabric version npm -w @erase2d/fabric publish ``` diff --git a/package-lock.json b/package-lock.json index f2e214d..3b6ceb3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6364,7 +6364,7 @@ }, "packages/fabric": { "name": "@erase2d/fabric", - "version": "1.1.5", + "version": "1.1.6", "license": "MIT", "devDependencies": { "@erase2d/core": "file:../core", diff --git a/packages/fabric/package.json b/packages/fabric/package.json index 85d6751..676a89b 100644 --- a/packages/fabric/package.json +++ b/packages/fabric/package.json @@ -1,6 +1,6 @@ { "name": "@erase2d/fabric", - "version": "1.1.5", + "version": "1.1.6", "description": "Fabric.js erase2d bindings", "type": "module", "scripts": {