From 01569aab8901ccab0a1c969ae9fef84d4ed95b35 Mon Sep 17 00:00:00 2001 From: gewlitys Date: Thu, 13 Mar 2003 14:26:54 +0000 Subject: [PATCH] Prevents GetScaledExtent from truncating values to 0; fixes partially 'small-objects-disappearing-bug' (#34), from chmmravatar git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@882 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/graphics/sdl/canvas.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sc2/src/sc2code/libs/graphics/sdl/canvas.c b/sc2/src/sc2code/libs/graphics/sdl/canvas.c index 5e7f9bb0b..a81f8726e 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/canvas.c +++ b/sc2/src/sc2code/libs/graphics/sdl/canvas.c @@ -273,6 +273,10 @@ 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) + size->width = 1; + if (!size->height) + size->height = 1; } void