mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-01 18:01:06 +02:00
fontrender: fix width calculation of bounding box
some glyphs would still draw right of the allocated space,
fix the width calculation to avoid this
Origin commit data
------------------
Branch: ni/coolstream
Commit: 24b02050c0
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2018-02-04 (Sun, 04 Feb 2018)
------------------
This commit was generated by Migit
This commit is contained in:
committed by
vanhofen
parent
e46f6602a7
commit
82446ebc91
@@ -650,7 +650,8 @@ void Font::RenderString(int x, int y, const int width, const char *text, const f
|
|||||||
if (x + glyph->xadvance + spread_by > left + width)
|
if (x + glyph->xadvance + spread_by > left + width)
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
int ap=(x + glyph->left) * sizeof(fb_pixel_t) + stride * (y - glyph->top);
|
int xoff = x + glyph->left;
|
||||||
|
int ap = xoff * sizeof(fb_pixel_t) + stride * (y - glyph->top);
|
||||||
uint8_t * d = ((uint8_t *)buff) + ap;
|
uint8_t * d = ((uint8_t *)buff) + ap;
|
||||||
uint8_t * s = glyph->buffer;
|
uint8_t * s = glyph->buffer;
|
||||||
int w = glyph->width;
|
int w = glyph->width;
|
||||||
@@ -662,7 +663,7 @@ void Font::RenderString(int x, int y, const int width, const char *text, const f
|
|||||||
int ax;
|
int ax;
|
||||||
for (ax = 0; ax < w + spread_by; ax++) {
|
for (ax = 0; ax < w + spread_by; ax++) {
|
||||||
/* width clip */
|
/* width clip */
|
||||||
if (x + ax > left + width)
|
if (xoff + ax >= left + width)
|
||||||
break;
|
break;
|
||||||
if (stylemodifier != Font::Embolden) {
|
if (stylemodifier != Font::Embolden) {
|
||||||
/* do not paint the backgroundcolor (*s = 0) */
|
/* do not paint the backgroundcolor (*s = 0) */
|
||||||
|
Reference in New Issue
Block a user