aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2015-12-09 20:22:42 +0100
committerraysan5 <raysan5@gmail.com>2015-12-09 20:22:42 +0100
commit2bd72455080409f1d9ecc6c5576f58c1ff093c3f (patch)
tree3ddfe7fa1cac05eda9f012b48e623903f0c894f9 /src
parentb62f7c3057cdfefacb9dc46e3096ea377a7f05a6 (diff)
downloadraylib-2bd72455080409f1d9ecc6c5576f58c1ff093c3f.tar.gz
raylib-2bd72455080409f1d9ecc6c5576f58c1ff093c3f.zip
DrawTextureRec() function review to allow flipped rectangle
Diffstat (limited to 'src')
-rw-r--r--src/textures.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/textures.c b/src/textures.c
index 27046b61..f97812da 100644
--- a/src/textures.c
+++ b/src/textures.c
@@ -1206,7 +1206,7 @@ void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float sc
// Draw a part of a texture (defined by a rectangle)
void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint)
{
- Rectangle destRec = { (int)position.x, (int)position.y, sourceRec.width, sourceRec.height };
+ Rectangle destRec = { (int)position.x, (int)position.y, abs(sourceRec.width), abs(sourceRec.height) };
Vector2 origin = { 0, 0 };
DrawTexturePro(texture, sourceRec, destRec, origin, 0.0f, tint);