forked from Bodmer/TFT_eSPI
Update for Pico W, update sprite smooth font rendering
Update example for Pico W If a background colour is not specified for smooth font rendering in a sprite then read the sprite background pixel colour.
This commit is contained in:
@@ -2417,6 +2417,8 @@ void TFT_eSprite::drawGlyph(uint16_t code)
|
||||
{
|
||||
uint16_t fg = textcolor;
|
||||
uint16_t bg = textbgcolor;
|
||||
bool getBG = false;
|
||||
if (fg == bg) getBG = true;
|
||||
|
||||
// Check if cursor has moved
|
||||
if (last_cursor_x != cursor_x)
|
||||
@@ -2551,7 +2553,7 @@ void TFT_eSprite::drawGlyph(uint16_t code)
|
||||
else drawFastHLine( fxs, y + cy, fl, fg);
|
||||
fl = 0;
|
||||
}
|
||||
if (getColor) bg = getColor(x + cx, y + cy);
|
||||
if (getBG) bg = readPixel(x + cx, y + cy);
|
||||
drawPixel(x + cx, y + cy, alphaBlend(pixel, fg, bg));
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user