From 7d46626f9a70beca138ddecbba64b99a91083a17 Mon Sep 17 00:00:00 2001 From: gewlitys Date: Thu, 13 Mar 2003 14:48:31 +0000 Subject: [PATCH] GetScaledExtent truncation prevention now only triggers if original w/h != 0 git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@883 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/graphics/sdl/canvas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sc2/src/sc2code/libs/graphics/sdl/canvas.c b/sc2/src/sc2code/libs/graphics/sdl/canvas.c index a81f8726e..93ad103d3 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/canvas.c +++ b/sc2/src/sc2code/libs/graphics/sdl/canvas.c @@ -273,9 +273,9 @@ TFB_DrawCanvas_GetScaledExtent (TFB_Canvas src_canvas, int scale, PEXTENT size) SDL_Surface *src = (SDL_Surface *)src_canvas; size->width = (int) (src->w * scale / (float)GSCALE_IDENTITY); size->height = (int) (src->h * scale / (float)GSCALE_IDENTITY); - if (!size->width) + if (!size->width && src->w) size->width = 1; - if (!size->height) + if (!size->height && src->h) size->height = 1; }