Skip to content

Commit

Permalink
Use float for sprite source rectangle
Browse files Browse the repository at this point in the history
  • Loading branch information
Xeeynamo committed Jun 2, 2020
1 parent 97f3243 commit 44e756b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions OpenKh.Engine/Renders/ISpriteDrawing.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OpenKh.Imaging;
using OpenKh.Imaging;
using System;

namespace OpenKh.Engine.Renders
Expand Down Expand Up @@ -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; }
Expand All @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 44e756b

Please sign in to comment.