Fix:graphics/sdl:Fix clipping of streetnames on left edge of the screen.
authornorad <norad@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 9 Feb 2011 18:58:16 +0000 (18:58 +0000)
committernorad <norad@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 9 Feb 2011 18:58:16 +0000 (18:58 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4121 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/graphics/sdl/graphics_sdl.c

index 13fb4ed..3e23793 100644 (file)
@@ -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),