diff --git a/OpenRa.FileFormats/TileSheetBuilder.cs b/OpenRa.FileFormats/TileSheetBuilder.cs index 1fbe5cf3bc..b4845158cd 100644 --- a/OpenRa.FileFormats/TileSheetBuilder.cs +++ b/OpenRa.FileFormats/TileSheetBuilder.cs @@ -31,13 +31,16 @@ namespace OpenRa.FileFormats if (current == null) current = pageProvider(); - if (imageSize.Height > rowHeight || rowHeight == 0 || imageSize.Width + x > pageSize.Width) + if (rowHeight == 0 || imageSize.Width + x > pageSize.Width) { y += rowHeight; rowHeight = imageSize.Height; x = 0; } + if (imageSize.Height > rowHeight) + rowHeight = imageSize.Height; + if (y + imageSize.Height > pageSize.Height) { current = pageProvider();