-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EraserBrush created a Blurred Path on scaled Custom Path Object #7369
Comments
Hi, I am willing to contribute and fix this issue (If it is an issue!!), due to some time constraints I have. Can someone guide me on where to look into EraserBrush, and what might be causing this issue, so that I can raise a fix. Let me know, if I can be of any help here. |
The same happens with a highly scaled image as well!! I confirmed by scaling the Background image 10x, in the example http://fabricjs.com/erasing, and erasing the background, made the clip-path blurry. |
Okay!! Scaling doesn't work properly with clipPaths I guess, not sure why because scaling a shape doesn't blur the object, but scaling a clipPath inside a shape blurs it. Anyways, as of now, I fixed this issue by modifying the const getNewPath = (scaleX, scaleY) => {
const path = (this.originalStar.path || []);
return path.map((cmd) => {
return [cmd[0], cmd[1] * scaleX, cmd[2] * scaleY];
});
};
const newWidth = scaleX * size;
const newHeight = scaleY * size;
activeObj.set({
// scaleX: Math.abs(this.startX - pointer.x) / 22,
// scaleY: Math.abs(this.startY - pointer.y) / 22,
path: this.getNewPath(scaleX, scaleY),
width: newWidth,
height: newHeight,
pathOffset: {
x: scaleX * this.originalStar.pathOffset.x,
y: scaleY * this.originalStar.pathOffset.y,
}
}); This works, but not sure if this can be considered as a solution, because scaling (as per my knowledge) is much faster compared to modifying the actual points in the Path. Correct me if I am wrong here!! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi @phoenisx, |
Thanks, @ShaMan123 Closing this, as it's being tracked here: #7186 |
I saw something that might help #7300 |
Version
Custom Build with EraserBrush, 4.6.0
Test Case
https://codesandbox.io/s/fabricjs-eraser-scale-issue-u077l?file=/src/Star.js
Information about environment
Codesandbox reproduction.
Steps to reproduce
Create a Path or loadSVG, and scale the Object.
Erase the object with EraserBrush.
Expected Behavior
Actual Behavior
mouse:up
, the erased portion gets blurred.The text was updated successfully, but these errors were encountered: