Here is the link to my JSFiddle project: http://jsfiddle.net/UTf87/ I am facing an issue where the rectangle I intended to display on my canvas is not showing up. Can anyone help me figure out why?
HTML:
<div id="CanvasContainer">
<canvas id="Canvas"></canvas>
</div>
CSS:
#CanvasContainer {
float: left;
width: 270px;
height: 519px;
margin-left: 15px;
background: black;
}
#Canvas {
float: left;
overflow: hidden;
background: green;
}
Javascript:
window.onload = function () {
var canvas = new fabric.Canvas('CanvasContainer');
var rect = new fabric.Rect({
left: 100,
top: 100,
fill: 'red',
width: 20,
height: 20,
angle: 45
});
canvas.add(rect);
}