flip or/and mirror sprites with negative width and heigth
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
|
||||||
namespace OpenRA.Graphics
|
namespace OpenRA.Graphics
|
||||||
@@ -37,10 +38,10 @@ namespace OpenRA.Graphics
|
|||||||
|
|
||||||
FractionalOffset = offset / Size;
|
FractionalOffset = offset / Size;
|
||||||
|
|
||||||
Left = (float)bounds.Left / sheet.Size.Width;
|
Left = (float)Math.Min(bounds.Left, bounds.Right) / sheet.Size.Width;
|
||||||
Top = (float)bounds.Top / sheet.Size.Height;
|
Top = (float)Math.Min(bounds.Top, bounds.Bottom) / sheet.Size.Height;
|
||||||
Right = (float)bounds.Right / sheet.Size.Width;
|
Right = (float)Math.Max(bounds.Left, bounds.Right) / sheet.Size.Width;
|
||||||
Bottom = (float)bounds.Bottom / sheet.Size.Height;
|
Bottom = (float)Math.Max(bounds.Top, bounds.Bottom) / sheet.Size.Height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user