diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-31 09:17:09 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-31 14:46:52 +0300 |
commit | b02c72a21692435dd974c2b767ee3e003ed6f846 (patch) | |
tree | 6de34f79c93c7afb12928eefa95d412bf15e5d32 | |
parent | 6cebd826920f2a8164e759bbc02eab67fb2dc1b2 (diff) |
Media: Fixed image resizing when there is no maximum texture size
-rw-r--r-- | src/media.c | 3 |
1 files changed, 2 insertions, 1 deletions
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) { | |||
98 | /* Resize down to min(maximum texture size, window size). */ { | 98 | /* Resize down to min(maximum texture size, window size). */ { |
99 | SDL_Rect dispRect; | 99 | SDL_Rect dispRect; |
100 | SDL_GetDisplayBounds(SDL_GetWindowDisplayIndex(window->win), &dispRect); | 100 | SDL_GetDisplayBounds(SDL_GetWindowDisplayIndex(window->win), &dispRect); |
101 | const iInt2 maxSize = min_I2(maxTextureSize_Window(window), | 101 | const iInt2 maxSize = min_I2(isEqual_I2(maxTextureSize_Window(window), zero_I2()) ? |
102 | texSize : maxTextureSize_Window(window), | ||
102 | coord_Window(window, dispRect.w, dispRect.h)); | 103 | coord_Window(window, dispRect.w, dispRect.h)); |
103 | iInt2 scaled = d->size; | 104 | iInt2 scaled = d->size; |
104 | if (scaled.x > maxSize.x) { | 105 | if (scaled.x > maxSize.x) { |