Skip to content

Can't clone an erased fabric object #44

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

Closed
hamzawain7 opened this issue Jul 25, 2024 · 2 comments
Closed

Can't clone an erased fabric object #44

hamzawain7 opened this issue Jul 25, 2024 · 2 comments

Comments

@hamzawain7
Copy link

hamzawain7 commented Jul 25, 2024

I am getting the following error when trying to clone an erased fabric object because your clipping group class doesn't exist in fabric:

Error: fabric: No class registered for clipping
at ClassRegistry.getClass (ClassRegistry.ts:30:13)
at objectEnlive.ts:109:12
at Array.map ()
at objectEnlive.ts:107:15
at new Promise ()
at enlivenObjects (objectEnlive.ts:103:3)
at objectEnlive.ts:159:16
at Array.map ()
at objectEnlive.ts:153:54

By the way, do I need to do something with the src/mixins/eraser_brush.mixin.ts file in fabricjs? I am also getting ts errors if I need to access the erasable property of fabric objects.

@ShaMan123
Copy link
Owner

ShaMan123 commented Jul 25, 2024

fabric.classRegistry.setClass(ClippingGroup)

Originally posted by @ShaMan123 in #42 (comment)

It should be handled under the hood...

I don't understand why that isn't enough. Check if the published version contains this line. I will try to rememeber doing that as well.

@hamzawain7
Copy link
Author

Okay, nevermind. This was due to me using a fork of fabric. Your code was using the classRegistry of the original fabric. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants