Skip to content

Commit

Permalink
Update FlxTileSpecial.hx
Browse files Browse the repository at this point in the history
Rotations should happen before flippings: Fixes bug in some combinations.
  • Loading branch information
cwkx committed May 7, 2014
1 parent 645de8b commit b1c8b80
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions flixel/addons/tile/FlxTileSpecial.hx
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,6 @@ class FlxTileSpecial extends FlxBasic
}

_matrix.identity();
if (_tmp_flipH)
{
_matrix.scale( -1, 1);
_matrix.translate(width, 0);
}
if (_tmp_flipV)
{
_matrix.scale(1, -1);
_matrix.translate(0, height);
}

if (_tmp_rot != FlxTileSpecial.ROTATE_0)
{
Expand All @@ -268,6 +258,17 @@ class FlxTileSpecial extends FlxBasic
}
}

if (_tmp_flipH)
{
_matrix.scale( -1, 1);
_matrix.translate(width, 0);
}
if (_tmp_flipV)
{
_matrix.scale(1, -1);
_matrix.translate(0, height);
}

return _matrix;
}
}
Expand All @@ -278,4 +279,4 @@ typedef AnimParams =
var flipHorizontal:Bool;
var flipVertical:Bool;
var rotate:Int;
}
}

0 comments on commit b1c8b80

Please sign in to comment.