1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-26 06:28:35 +01:00

don't unnecessarily cast ninepatch regions to int

This commit is contained in:
Ellpeck 2020-04-26 16:10:32 +02:00
parent 52328cc18d
commit 35f53a978b

View file

@ -37,10 +37,10 @@ namespace MLEM.Textures {
} }
public IEnumerable<RectangleF> CreateRectangles(RectangleF area, float patchScale = 1) { public IEnumerable<RectangleF> CreateRectangles(RectangleF area, float patchScale = 1) {
var pl = (int) (this.Padding.Left * patchScale); var pl = this.Padding.Left * patchScale;
var pr = (int) (this.Padding.Right * patchScale); var pr = this.Padding.Right * patchScale;
var pt = (int) (this.Padding.Top * patchScale); var pt = this.Padding.Top * patchScale;
var pb = (int) (this.Padding.Bottom * patchScale); var pb = this.Padding.Bottom * patchScale;
var centerW = area.Width - pl - pr; var centerW = area.Width - pl - pr;
var centerH = area.Height - pt - pb; var centerH = area.Height - pt - pb;