Skip to content

Commit

Permalink
[#591] We can save 2 bytes just by changing the order of operations!
Browse files Browse the repository at this point in the history
  • Loading branch information
parasyte committed Dec 28, 2014
1 parent fd415b6 commit bd7a093
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/level/TMXTileset.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@
this.transform.translate(0, this.height - this.width);
}
if (this.flippedX) {
this.transform.translate((this.flippedAD ? this.height : this.width), 0);
a[0] *= -1;
a[3] *= -1;
this.transform.translate(-(this.flippedAD ? this.height : this.width), 0);

}
if (this.flippedY) {
this.transform.translate(0, (this.flippedAD ? this.width : this.height));
a[1] *= -1;
a[4] *= -1;
this.transform.translate(0, -(this.flippedAD ? this.width : this.height));
}
}
});
Expand Down

1 comment on commit bd7a093

@parasyte
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does anyone know how to create a Tiled object with with the flippedAD flag set? I remember looking for examples a long time ago, and couldn't find any information except that it means "flipped Anti-Diagonally" ... It will be hard to test the above code without an example.

Please sign in to comment.