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

BackgroundImage not cleared on LoadFromJSON #3296

Closed
ncou opened this issue Sep 28, 2016 · 4 comments · Fixed by #3305
Closed

BackgroundImage not cleared on LoadFromJSON #3296

ncou opened this issue Sep 28, 2016 · 4 comments · Fixed by #3305

Comments

@ncou
Copy link
Collaborator

ncou commented Sep 28, 2016

Hi,

A)
I think there is a bug in the LoadFromJSON with an empty json string.

I init a canvas with a shape+a background color+an background image

I try to load a new JSON, or an empty JSON (based on the static EMPTY_JSON string), and the shape+background color is cleared, but the background image stay.
I need to explicitely set it to null to clear the background image (with the setter function, i tried to set it to null or '' in the json, but it doesn't work this way).

This look like a wrong behaviours.

Here is a basic example, using the fabric 1.6.4 library.
http://codepen.io/anon/pen/mAwzYO?editors=1111

B)
And the clear signal seem to be called 2 time ??? it's strange. I have added a bind on the onclear event, and the event is fired 2 times when i load a json file. Is that also a bug ?

Thank you for your help. keep up the good work.
Sorry for my poor english

Kind regards.

@nemeth-it
Copy link

Can confirm this issue.

@asturur
Copy link
Member

asturur commented Oct 1, 2016

yes image and overlay are not removed on canvas.clear.
I guess if i have to modify clear or modify load from json.

@ncou
Copy link
Collaborator Author

ncou commented Oct 1, 2016

And the "clear()" function called 2 times when the json is loaded, is that normal ?

@asturur
Copy link
Member

asturur commented Oct 1, 2016

i can check but that is minor annoyance. the clear funtion does very littlr

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

Successfully merging a pull request may close this issue.

3 participants