Explorar o código

Corrected issue on rectangle drawing

Ray %!s(int64=7) %!d(string=hai) anos
pai
achega
9ea2a69bfd
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/textures.c

+ 1 - 1
src/textures.c

@@ -2029,7 +2029,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 = { position.x, position.y, sourceRec.width, sourceRec.height };
+    Rectangle destRec = { position.x, position.y, sourceRec.width, fabsf(sourceRec.height) };
     Vector2 origin = { 0, 0 };
 
     DrawTexturePro(texture, sourceRec, destRec, origin, 0.0f, tint);