From: norad Date: Wed, 9 Feb 2011 18:58:16 +0000 (+0000) Subject: Fix:graphics/sdl:Fix clipping of streetnames on left edge of the screen. X-Git-Tag: navit-0.5.0.5194svn~1074 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c1ecdfbb577f2ca2bc2ce8e29ecf7c5b01933fb1;p=profile%2Fivi%2Fnavit.git Fix:graphics/sdl:Fix clipping of streetnames on left edge of the screen. git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4121 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- diff --git a/navit/navit/graphics/sdl/graphics_sdl.c b/navit/navit/graphics/sdl/graphics_sdl.c index 13fb4ed..3e23793 100644 --- a/navit/navit/graphics/sdl/graphics_sdl.c +++ b/navit/navit/graphics/sdl/graphics_sdl.c @@ -1042,10 +1042,10 @@ display_text_draw(struct font_freetype_text *text, y += g->dy; } - x = p->x << 6; - y = p->y << 6; gp = text->glyph; i = text->glyph_count; + x = p->x << 6; + y = p->y << 6; while (i-- > 0) { g = *gp++; if (g->w && g->h) { @@ -1080,13 +1080,10 @@ display_text_draw(struct font_freetype_text *text, unsigned char* pGlyph = glyph; for (jj = 0; jj < g->h; ++jj) { for (ii = 0; ii < g->w; ++ii) { - int sx = (x + g->x) >> 6; - int sy = (y + g->y) >> 6; - sx = sx < 0 ? 0 : sx; - sy = sy < 0 ? 0 : sy; - - if(*(pGlyph+0)>10 || *(pGlyph+1)>10 || *(pGlyph+2)>10 || *(pGlyph+3)>10) { - set_pixel(gr->screen, ii+sx, jj+sy, + if(*(pGlyph+3) > 0) { + set_pixel(gr->screen, + ii+((x + g->x) >> 6), + jj+((y + g->y) >> 6), *(pGlyph+2), // Pixels are in BGRA format *(pGlyph+1), *(pGlyph+0),