I am attempting to layer two canvases, so that one has a background image and the other can have a different image on it. When I layer them in, the width and height resets to the default 300x150px of a canvas instead of respecting the width/height I put in. The canvas with the id of 'c' is my top layer
Here is my HTML:
<div class="col-md-6">
<div style="position:relative; border:1px solid">
<canvas id="b" style="position:absolute; left:0; top:0; z-index:1; width:640px; height:429px;"></canvas>
<canvas id="c" style="position:absolute; left:0; top:0; z-index:2; width:640px; height:429px;"></canvas>
</div>
I am using fabric.js to create the canvases as follows:
var canvasb = new fabric.Canvas('b');
canvasb.setBackgroundImage('imgs/mybackgroundimage.png', canvasb.renderAll.bind(canvasb));
var canvas = new fabric.Canvas('c');