I found the Answer. Apperently canvas needs one additional parameter to count coordinates from top left instead of center.
I changed the js code to:
var canvas = $("canvas");
//white background in canvas
canvas.drawRect({
fillStyle: "#FFF",
x: 0, y: 0,
width: 600,
height: 400,
fromCenter: false
});
And now it works as expected!
You can also change the default behavior by calling this method:
$.jCanvas({
fromCenter: false
});
In the beginning of the script