所以我有这个小提琴完全解释了我的问题。用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