diff --git a/src/driver/fontrenderer.cpp b/src/driver/fontrenderer.cpp index 47465e649..21b967efc 100644 --- a/src/driver/fontrenderer.cpp +++ b/src/driver/fontrenderer.cpp @@ -644,10 +644,11 @@ void Font::RenderString(int x, int y, const int width, const char *text, const f x += (kerning.x) >> 6; // kerning! } +#if 0 // width clip if (x + glyph->xadvance + spread_by > left + width) break; - +#endif int ap=(x + glyph->left) * sizeof(fb_pixel_t) + stride * (y - glyph->top); uint8_t * d = ((uint8_t *)buff) + ap; uint8_t * s = glyph->buffer; @@ -659,6 +660,9 @@ void Font::RenderString(int x, int y, const int width, const char *text, const f fb_pixel_t * td = (fb_pixel_t *)d; int ax; for (ax = 0; ax < w + spread_by; ax++) { + /* width clip */ + if (x + ax > left + width) + break; if (stylemodifier != Font::Embolden) { /* do not paint the backgroundcolor (*s = 0) */ if (*s != 0)