# HG changeset patch # User nemo # Date 1330440048 18000 # Node ID 5eb087708fbd98a89fbb8ab867d6a9e3b7fbed9c # Parent 6bb0cea803bdaa4e4b64292395f5b4df9d003aa5 attractiveness tweak to the text clip diff -r 6bb0cea803bd -r 5eb087708fbd hedgewars/uRenderUtils.pas --- a/hedgewars/uRenderUtils.pas Mon Feb 27 19:01:44 2012 -0500 +++ b/hedgewars/uRenderUtils.pas Tue Feb 28 09:40:48 2012 -0500 @@ -70,7 +70,7 @@ var w, h: LongInt; tmpsurf: PSDL_Surface; clr: TSDL_Color; - finalRect: TSDL_Rect; + finalRect, textRect: TSDL_Rect; begin TTF_SizeUTF8(Fontz[Font].Handle, Str2PChar(s), @w, @h); if (maxLength <> 0) and (w > maxLength) then w := maxLength; @@ -78,6 +78,10 @@ finalRect.y:= Y; finalRect.w:= w + FontBorder * 2 + 4; finalRect.h:= h + FontBorder * 2; + textRect.x:= X; + textRect.y:= Y; + textRect.w:= w; + textRect.h:= h; DrawRoundRect(@finalRect, cWhiteColor, endian(cNearBlackColorChannels.value), Surface, true); clr.r:= (Color shr 16) and $FF; clr.g:= (Color shr 8) and $FF; @@ -86,7 +90,7 @@ finalRect.x:= X + FontBorder + 2; finalRect.y:= Y + FontBorder; SDLTry(tmpsurf <> nil, true); - SDL_UpperBlit(tmpsurf, nil, Surface, @finalRect); + SDL_UpperBlit(tmpsurf, @textRect, Surface, @finalRect); SDL_FreeSurface(tmpsurf); finalRect.x:= X; finalRect.y:= Y;