Skip to content

Conversation

karlvr
Copy link
Contributor

@karlvr karlvr commented Feb 2, 2019

This allows loading of cross origin images by adding crossOrigin: 'anonymous' to the options object. Using the existing setBackgroundFromDataUrl method it is not possible to use cross origin images as that implementation loads the Image first, and doesn't include a crossOrigin setting.

The same cross origin issue probably exists in addImg but I have not had a chance to investigate yet!

This allows loading of crossOrigin images by adding crossOrigin: ‘anonymous’ to the options object.
@karlvr
Copy link
Contributor Author

karlvr commented Feb 5, 2019

I've taken the liberty of adding a setBackgroundFromImage method too. This refactors the existing setBackgroundFromDataURL method to load the Image and then use the new method. I've used this form when I load the Image first in order to get things like its width and height, and then it's nice just to pass it directly to react-sketch.

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 this pull request may close these issues.

1 participant