I'm trying to change canvas background with Pattern:
this.canvas.setBackgroundColor(new fabric.Pattern({source: url, repeat: 'repeat'}),
()=> {
this.canvas.renderAll();
});
I'm using an external url like this: https://cdn.pixabay.com/photo/2016/02/20/02/21/colorful-1211510_960_720.png
The canvas is created and working, but the background image doesn't appear unless I make zoom (in or out) to the canvas, as I do it background appears.
Why do you think that I'm having this problem? Am I doing anything wrong? How could I fix this behaviour?
I don't know the ins and outs of this but according to the docs for: backgroundImage :fabric.Image, the image needs to be bound to the canvas it is on. Maybe it is the same with setting patterns through the
backgroundColorproperty.Here's a working example: https://jsfiddle.net/sunny001/cb4eqjf1/44/