【发布时间】:2014-06-03 18:16:05
【问题描述】:
所以我有这个完全解释了我的问题的小提琴。
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();
【问题讨论】:
-
也许这个小提琴的方向会帮助理解画布的反应。 jsfiddle.net/hph4e/10