summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2021-12-07 19:06:18 +0100
committerraysan5 <[email protected]>2021-12-07 19:06:18 +0100
commit7d25480723cfabbc0ab9994ac2b99df676bada41 (patch)
treefd433effa343c545a4c130bc016c94c47cd1f2fc /src
parent81240fe96068dfe80f8bd03e169da54bde232818 (diff)
downloadraylib-7d25480723cfabbc0ab9994ac2b99df676bada41.tar.gz
raylib-7d25480723cfabbc0ab9994ac2b99df676bada41.zip
REVIEWED: DrawTextureTiled() #2173
Diffstat (limited to 'src')
-rw-r--r--src/rtextures.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/rtextures.c b/src/rtextures.c
index e5c3c100..4269f68f 100644
--- a/src/rtextures.c
+++ b/src/rtextures.c
@@ -3202,6 +3202,7 @@ void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangl
void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint)
{
if ((texture.id <= 0) || (scale <= 0.0f)) return; // Wanna see a infinite loop?!...just delete this line!
+ if ((source.width == 0) || (source.height == 0)) return;
int tileWidth = (int)(source.width*scale), tileHeight = (int)(source.height*scale);
if ((dest.width < tileWidth) && (dest.height < tileHeight))