ShaMan123 / erase2d

A simple erasing tool for canvas apps
https://shaman123.github.io/erase2d/
Other
14 stars 3 forks source link

Eraser wrong bbox #35

Closed rutvikpankhania closed 2 months ago

rutvikpankhania commented 3 months ago

https://github.com/ShaMan123/erase2d/assets/46224428/3e54b6c7-381c-49e0-b37d-0bded7092470

import * as fabric from 'fabric'; import { EraserBrush, ClippingGroup } from '@erase2d/fabric';

Using Pencil Brush for free-hand drawing canvas.isDrawingMode = true; canvas.freeDrawingBrush = new fabric.PencilBrush(canvas); canvas.freeDrawingBrush.color = #${anyColour}; canvas.freeDrawingBrush.width = 20;

Using Eraser from @erase2d/fabric canvas.isDrawingMode = true; const eraser = new EraserBrush(canvas); eraser.width = 30; eraser.on('end', e => { e.preventDefault(); eraser.commit(e.detail); }); canvas.freeDrawingBrush = eraser;

@ShaMan123 As you can see in the video, its seems like Cropping the area. Please look into this issue and help me to resolve this issue.

Thanks a lot for your time.

ShaMan123 commented 3 months ago

What version of fabric are you using?

rutvikpankhania commented 3 months ago

"fabric": "^6.0.0-rc2", "@erase2d/fabric": "^1.1.1",

ShaMan123 commented 3 months ago

In that case it is a duplicate of #34 Try beta18

ShaMan123 commented 2 months ago

This has been resolved in version 1.1.2

timfrans commented 2 months ago

I still have this issue using version 1.1.3 and fabric version 6.0.0-rc2.

When drawing a diagonal line using the fabric PencilBrush and clicking in the bounding rectangle of this path, the clipPath seems to be incorrect. It clips a part on both sides of the Path.

The Path is a child of another group which has erasable set to deep. Each path in this group has erasable set to true. You can find an example of the result in the screenshot below: before: Screenshot 2024-06-25 at 17 58 44 after (drawing a dot inside the bounding rectangle, not even on the orange Path): Screenshot 2024-06-25 at 17 58 18

The expected behaviour is that nothing is eraser of the orange line when clicking inside the bounding rectangle.

Thanks for helping.

ShaMan123 commented 2 months ago

please try 1.1.6 and report back

timfrans commented 2 months ago

1.1.6 fixes this issue.

Thanks!