Fabric rotate coords

by Andrea Bogazzi

HTML

<canvas id="canvasCont" width="300" height="300"></canvas>
<!--
To reproduce:

1. Move rect to see coords in developer console (move by 1-2 px)
2. Rotate to see new weird coords, (1-2º is enough)
3. Move again 1-2 px, and new coords...
-->

JavaScript

var canvas = new fabric.Canvas('canvasCont');

canvas.backgroundColor = '#e3e3e3';
canvas.add(new fabric.Rect({
    top: 100,
    left: 50,
    width: 150,
    height: 50,
    fill: 'red',

}));

canvas.observe('object:modified', function (e) {
    console.log("X: " + e.target.left.toString() + " Y: " + e.target.top.toString());
});