From ca13423a3e9022241e8f460065189454f3d7fc9b Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 6 Apr 2013 17:47:06 +0200 Subject: [PATCH] fontrenderer: use background color of framebuffer Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e66b57cd8894dcea92b6f629c3cc39deb8d9a13b Author: Stefan Seyfried Date: 2013-04-06 (Sat, 06 Apr 2013) --- src/driver/fontrenderer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/driver/fontrenderer.cpp b/src/driver/fontrenderer.cpp index 662e3968a..163c8aaa0 100644 --- a/src/driver/fontrenderer.cpp +++ b/src/driver/fontrenderer.cpp @@ -432,7 +432,10 @@ void Font::RenderString(int x, int y, const int width, const char *text, const u static fb_pixel_t oldbgcolor = 0, oldfgcolor = 0; static fb_pixel_t colors[256]={0}; - fb_pixel_t bgcolor = frameBuffer->realcolor[color]; + /* fetch bgcolor from framebuffer, using lower left edge of the font... */ + fb_pixel_t bgcolor = *(frameBuffer->getFrameBufferPointer() + x + + y * frameBuffer->getStride() / sizeof(fb_pixel_t)); + // fb_pixel_t bgcolor = frameBuffer->realcolor[color]; fb_pixel_t fgcolor = frameBuffer->realcolor[(((((int)color) + 2) | 7) - 2)]; if((oldbgcolor != bgcolor) || (oldfgcolor != fgcolor)) {