I use fabric.js and I need a transparent rect to be on a canvas, but I need to use background.
The problem is that I need background to be transparent under the rect.
I've created a fiddle to illustrate my problem: http://jsfiddle.net/goooseman/5xLE4/2/ (I need background to be transparent under the square).
I think that it is impossible to make a hole in a background, but we can use another rect as a background. I've created another fiddle to show it: http://jsfiddle.net/goooseman/cNJwL/1/ I use this code to make background rect:
var backgroundRect = new fabric.Rect({
left: 0,
top: 0,
fill: 'red',
width: canvas.width,
height: canvas.height
});
But how can I make a hole in the background rect under the upper rect?