Closed rutvikpankhania closed 2 months ago
What version of fabric are you using?
"fabric": "^6.0.0-rc2", "@erase2d/fabric": "^1.1.1",
In that case it is a duplicate of #34 Try beta18
This has been resolved in version 1.1.2
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:
after (drawing a dot inside the bounding rectangle, not even on the orange Path):
The expected behaviour is that nothing is eraser of the orange line when clicking inside the bounding rectangle.
Thanks for helping.
please try 1.1.6 and report back
1.1.6 fixes this issue.
Thanks!
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.