所以我有這個小提琴完全解釋了我的問題。用CSS調整畫布傾斜鼠標動作
的JS
var w = this.w * this.scale;
var h = this.h * this.scale;
var x = this.x - w * .5;
var y = this.y - h * .5;
//standard Canvas rotation operation
ctx.save();
ctx.translate(this.x, this.y);
ctx.rotate(this.rotation * Math.PI/180);
ctx.fillStyle = this.fillStyle;
ctx.fillRect(w * -0.5, h * -0.5, w, h);
ctx.restore();
也許這小提琴的方向將HEL明白畫布迴應。 http://jsfiddle.net/hph4e/10/ – Shouvik 2010-11-13 05:01:07