From 5c593be13fccc34f8d4f2c17de8f80d7046a9617 Mon Sep 17 00:00:00 2001 From: avolkov Date: Thu, 12 Jan 2006 03:48:37 +0000 Subject: [PATCH] Fix handling non-present chars at end of line git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2165 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/graphics/font.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sc2/src/sc2code/libs/graphics/font.c b/sc2/src/sc2code/libs/graphics/font.c index 0d0dc5b7e..bcd2dd04d 100644 --- a/sc2/src/sc2code/libs/graphics/font.c +++ b/sc2/src/sc2code/libs/graphics/font.c @@ -204,8 +204,11 @@ TextRect (PTEXT lpText, PRECT pRect, PBYTE pdelta) if (width > 0 && (bot_y -= top_y) > 0) { /* subtract off default character spacing */ - --pdelta[-1]; - --width; + if (pdelta[-1] > 0) + { + --pdelta[-1]; + --width; + } if (lpText->align == ALIGN_LEFT) pRect->corner.x = 0;