mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 12:58:33 +01:00
Fixed tiled NinePatches missing pixels with some scales
This commit is contained in:
parent
51833d523d
commit
ff510c54c5
2 changed files with 2 additions and 1 deletions
|
@ -21,6 +21,7 @@ Improvements
|
||||||
Fixes
|
Fixes
|
||||||
- Set default values for InputHandler held and pressed keys to avoid an exception if buttons are held in the very first frame
|
- 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 GenericFont MeasureString using incorrect width for Zwsp and OneEmSpace
|
||||||
|
- Fixed tiled NinePatches missing pixels with some scales
|
||||||
|
|
||||||
### MLEM.Ui
|
### MLEM.Ui
|
||||||
Additions
|
Additions
|
||||||
|
|
|
@ -166,7 +166,7 @@ namespace MLEM.Textures {
|
||||||
for (var x = 0F; x < rect.Width; x += width) {
|
for (var x = 0F; x < rect.Width; x += width) {
|
||||||
for (var y = 0F; y < rect.Height; y += height) {
|
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));
|
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;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue