From 82c5154a915ac678dccbf138f040c32c56d801ba Mon Sep 17 00:00:00 2001 From: chrisf Date: Fri, 6 Jul 2007 12:24:39 +0000 Subject: [PATCH] allow tilesheet row height to dynamically increase, to reduce premature splits git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1116 993157c7-ee19-0410-b2c4-bb4e9862e678 --- OpenRa.FileFormats/TileSheetBuilder.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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();