diff --git a/CHANGELOG.md b/CHANGELOG.md index bca1a6a..00357fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ Improvements Fixes - Set default values for InputHandler held and pressed keys to avoid an exception if buttons are held in the very first frame - Fixed GenericFont MeasureString using incorrect width for Zwsp and OneEmSpace +- Fixed tiled NinePatches missing pixels with some scales ### MLEM.Ui Additions diff --git a/MLEM/Textures/NinePatch.cs b/MLEM/Textures/NinePatch.cs index d08e4c9..18c8645 100644 --- a/MLEM/Textures/NinePatch.cs +++ b/MLEM/Textures/NinePatch.cs @@ -166,7 +166,7 @@ namespace MLEM.Textures { for (var x = 0F; x < rect.Width; x += width) { for (var y = 0F; y < rect.Height; y += height) { var size = new Vector2(Math.Min(rect.Width - x, width), Math.Min(rect.Height - y, height)); - batch.Draw(texture.Region.Texture, new RectangleF(rect.Location + new Vector2(x, y), size), new Rectangle(src.Location, (size / patchScale).ToPoint()), color, rotation, origin, effects, layerDepth); + batch.Draw(texture.Region.Texture, new RectangleF(rect.Location + new Vector2(x, y), size), new Rectangle(src.Location, (size / patchScale).CeilCopy().ToPoint()), color, rotation, origin, effects, layerDepth); } } break;