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

Pattern as Image background isn't loaded from JSON. #3548

Closed
ncou opened this issue Dec 18, 2016 · 4 comments · Fixed by #3550
Closed

Pattern as Image background isn't loaded from JSON. #3548

ncou opened this issue Dec 18, 2016 · 4 comments · Fixed by #3550

Comments

@ncou
Copy link
Collaborator

ncou commented Dec 18, 2016

Hi,

I can add as backgroundImage a pattern, but if i export it to json and load it again, i lost the pattern.

Here is a fiddle :
http://jsfiddle.net/YH9yD/292/

I try to load in the second canvas, the serialized json from the first canvas.
But the pattern isn't loaded.

@asturur
Copy link
Member

asturur commented Dec 19, 2016

yes there was an error, i submitted a fix.
There is a problem anyway, fabric does not load the patter syncronously, so the rects get created and cached without the pattern.
After tha canvas is loaded you have to manually set canvas.backgroundImage.dirty = true to force a re render.

@asturur
Copy link
Member

asturur commented Dec 19, 2016

taking care of this asyncronos problem, is an open issue since 2013, time to close it.

@ncou
Copy link
Collaborator Author

ncou commented Dec 19, 2016

so after the asunchronos problem is resolved, should I still use the property "canvas.backgroundImage.dirty = true" ? or this will be useless ?

@asturur
Copy link
Member

asturur commented Dec 19, 2016

no will be rendered first time correctly

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

Successfully merging a pull request may close this issue.

2 participants