From 44e756b2a922ff96e78aabbfe1f6b1857f728b05 Mon Sep 17 00:00:00 2001 From: Luciano Ciccariello Date: Tue, 2 Jun 2020 23:12:50 +0100 Subject: [PATCH] Use float for sprite source rectangle --- OpenKh.Engine/Renders/ISpriteDrawing.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/OpenKh.Engine/Renders/ISpriteDrawing.cs b/OpenKh.Engine/Renders/ISpriteDrawing.cs index e3192f207..ddb318b90 100644 --- a/OpenKh.Engine/Renders/ISpriteDrawing.cs +++ b/OpenKh.Engine/Renders/ISpriteDrawing.cs @@ -1,4 +1,4 @@ -using OpenKh.Imaging; +using OpenKh.Imaging; using System; namespace OpenKh.Engine.Renders @@ -68,10 +68,10 @@ public ColorF(float r, float g, float b, float a) public class SpriteDrawingContext { - public int SourceLeft { get; set; } - public int SourceTop { get; set; } - public int SourceRight { get; set; } - public int SourceBottom { get; set; } + public float SourceLeft { get; set; } + public float SourceTop { get; set; } + public float SourceRight { get; set; } + public float SourceBottom { get; set; } public float DestinationX { get; set; } public float DestinationY { get; set; } @@ -91,7 +91,7 @@ public static class SpriteDrawingContextExtensions { private static readonly ColorF ColorWhite = new ColorF(1.0f, 1.0f, 1.0f, 1.0f); - public static SpriteDrawingContext SourceLTRB(this SpriteDrawingContext context, int left, int top, int right, int bottom) + public static SpriteDrawingContext SourceLTRB(this SpriteDrawingContext context, float left, float top, float right, float bottom) { context.SourceLeft = left; context.SourceTop = top; @@ -100,7 +100,7 @@ public static SpriteDrawingContext SourceLTRB(this SpriteDrawingContext context, return context; } - public static SpriteDrawingContext Source(this SpriteDrawingContext context, int x, int y, int width, int height) + public static SpriteDrawingContext Source(this SpriteDrawingContext context, float x, float y, float width, float height) { context.SourceLeft = x; context.SourceTop = y;