I'm using newest version of jquery's jcanvas plugin. When I rotate the object, it's x and y should change, but they don't. Should I call some method for those properties to be reset? I ommited script tags with reference to jquery, and jcanvas, since it's obvious they are there ;).
<head>
<style type="text/css">
canvas { border: 1px solid black; width: 400px; height: 400px; margin: 0 auto; }
</style>
<script type="text/javascript">
$(function() {
var cfg = {
strokeStyle : "#000",
strokeWidth : 1,
fillStyle : "#FF7400",
group : "objects",
cursor : "pointer",
x : 100,
y : 100,
width : 40,
height : 200,
fromCenter : false,
cornerRadius : 5,
layer : true,
draggable : true,
bringToFront : true,
};
$("#mine").drawRect(cfg);
console.log($("#mine").getLayer(0).x);
console.log($("#mine").getLayer(0).y);
$("#mine").animateLayer(0, {
rotate : "+=90",
}, "fast");
console.log($("#mine").getLayer(0).x);
console.log($("#mine").getLayer(0).y);
});
</script>
</head>
<body>
<div id="wrap">
<canvas width="400" height="400" id="mine">
</canvas>
</div>
</body>