From d6682faeee0fcb7dd5c2b559b513091b3c6ec563 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Mon, 23 Jul 2018 15:33:05 +0100 Subject: [PATCH] Keep a 1px border around trimmed ShpTD data. --- OpenRA.Mods.Common/SpriteLoaders/ShpTDLoader.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/OpenRA.Mods.Common/SpriteLoaders/ShpTDLoader.cs b/OpenRA.Mods.Common/SpriteLoaders/ShpTDLoader.cs index 0473a0516a..bce428371d 100644 --- a/OpenRA.Mods.Common/SpriteLoaders/ShpTDLoader.cs +++ b/OpenRA.Mods.Common/SpriteLoaders/ShpTDLoader.cs @@ -108,6 +108,19 @@ namespace OpenRA.Mods.Common.SpriteLoaders } } + // Keep a 1px empty border to work avoid rounding issues in the gpu shader + if (left > 0) + left -= 1; + + if (top > 0) + top -= 1; + + if (right < origSize.Width - 1) + right += 1; + + if (bottom < origSize.Height - 1) + bottom += 1; + var trimmedWidth = right - left + 1; var trimmedHeight = bottom - top + 1;