incorpoating the rotation fix that we did for wescheme

This commit is contained in:
Danny Yoo 2011-08-19 16:28:51 -04:00
parent 195cc8ab86
commit 177b94bd98

View File

@ -548,15 +548,14 @@ RotateImage.prototype.render = function(ctx, x, y) {
var sin = Math.sin(this.angle * Math.PI / 180),
cos = Math.cos(this.angle * Math.PI / 180),
r = Math.sqrt(x*x + y*y);
x = Math.ceil(cos * r);
y = -Math.floor(sin * r);
ctx.save();
ctx.translate(this.translateX, this.translateY);
ctx.translate(x + this.translateX, y + this.translateY);
ctx.rotate(this.angle * Math.PI / 180);
this.img.render(ctx, x, y);
this.img.render(ctx, 0, 0);
ctx.restore();
};
RotateImage.prototype.equals = function(other, aUnionFind) {
return ( other instanceof RotateImage &&
this.pinholeX == other.pinholeX &&