-
-
Notifications
You must be signed in to change notification settings - Fork 48
Closed
Labels
Description
I allowed every tile transformation in a map
But it comes broken from the renderer:
After I made some changes to RotateTileImage
, it looks as expected:
Here are the diff of the changes that I've made (I can create a PR if it's a valid fix):
diff --git a/render/orthogonal.go b/render/orthogonal.go
index 9e2d1d9..cfe762d 100644
--- a/render/orthogonal.go
+++ b/render/orthogonal.go
@@ -47,15 +47,15 @@ func (e *OrthogonalRendererEngine) GetFinalImageSize() image.Rectangle {
// RotateTileImage rotates provided tile layer.
func (e *OrthogonalRendererEngine) RotateTileImage(tile *tiled.LayerTile, img image.Image) image.Image {
timg := img
+ if tile.DiagonalFlip {
+ timg = imaging.FlipH(imaging.Rotate270(timg))
+ }
if tile.HorizontalFlip {
timg = imaging.FlipH(timg)
}
if tile.VerticalFlip {
timg = imaging.FlipV(timg)
}
- if tile.DiagonalFlip {
- timg = imaging.FlipH(imaging.Rotate90(timg))
- }
return timg
}