Skip to content
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

Conflicts with fabric.js #4

Open
poojakapuriya619 opened this issue May 18, 2020 · 3 comments
Open

Conflicts with fabric.js #4

poojakapuriya619 opened this issue May 18, 2020 · 3 comments

Comments

@poojakapuriya619
Copy link

It changes the default CanvasRenderingContext2d and therefore while adding text to canvas the method does not work properly.

Can you please help fix this?
Thanks in advance.

@davidenke
Copy link
Owner

davidenke commented May 18, 2020

I've no experiences with Fabric.js, but I think you can maybe trigger it's behavior after the polyfill has run.

Edit: Okay, I see the issue now after having a look at Fabric.js. I think you need to delay this polyfill after Fabric is run. So you need to load and apply the polyfill after Fabric did its magic (and maybe re-apply it after changes have been made). You can see here how the polyfill is applied. Lazy loading the script is some Stackoverflow research.
It'll may be easier to have a global short hand method to call the polyfill dynamically...

@poojakapuriya619
Copy link
Author

Thanks. I'll check this and let you know if it works.

@poojakapuriya619
Copy link
Author

I checked the lazy loading script. Unfortunately its not working in my case because once the script is loaded it again overrides the default behaviour of all methods. I want to add filters and text from frabic.js simultaneously.

The global method sounds like a solution but I am really new to polyfill. I downloaded js from demo and struggling to create a global class for the same. Could you please create a Js and add to your repo?

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

No branches or pull requests

2 participants