From b02c72a21692435dd974c2b767ee3e003ed6f846 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Wed, 31 Mar 2021 09:17:09 +0300 Subject: Media: Fixed image resizing when there is no maximum texture size --- src/media.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/media.c b/src/media.c index 28148ad7..c3b38ae3 100644 --- a/src/media.c +++ b/src/media.c @@ -98,7 +98,8 @@ void makeTexture_GmImage(iGmImage *d) { /* Resize down to min(maximum texture size, window size). */ { SDL_Rect dispRect; SDL_GetDisplayBounds(SDL_GetWindowDisplayIndex(window->win), &dispRect); - const iInt2 maxSize = min_I2(maxTextureSize_Window(window), + const iInt2 maxSize = min_I2(isEqual_I2(maxTextureSize_Window(window), zero_I2()) ? + texSize : maxTextureSize_Window(window), coord_Window(window, dispRect.w, dispRect.h)); iInt2 scaled = d->size; if (scaled.x > maxSize.x) { -- cgit v1.2.3