mirror of
https://github.com/photonstorm/phaser
synced 2024-11-26 06:30:38 +00:00
Fix TileSprite rotation.
The order of operations now no longer produces skew. Asymmetric scaling now no longer leaves some area untextured.
This commit is contained in:
parent
8e8b15841a
commit
9c3a1bdebb
1 changed files with 4 additions and 4 deletions
|
@ -558,16 +558,16 @@ var TileSprite = new Class({
|
|||
|
||||
ctx.save();
|
||||
|
||||
ctx.scale(scaleX, scaleY);
|
||||
|
||||
ctx.rotate(this._tileRotation);
|
||||
|
||||
ctx.scale(scaleX, scaleY);
|
||||
|
||||
ctx.translate(-positionX, -positionY);
|
||||
|
||||
ctx.fillStyle = this.fillPattern;
|
||||
|
||||
var scaledWidth = width / scaleX;
|
||||
var scaledHeight = height / scaleY;
|
||||
var scaledWidth = Math.max(width, Math.abs(width / scaleX));
|
||||
var scaledHeight = Math.max(height, Math.abs(height / scaleY));
|
||||
var hypotenuse = Math.sqrt(scaledWidth * scaledWidth + scaledHeight * scaledHeight);
|
||||
|
||||
ctx.fillRect(
|
||||
|
|
Loading…
Reference in a new issue