mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2025-07-29 18:27:35 +02:00
Fix #2400 for GC9A01
An odd one this. Pixels get lost in a stream with the GC9A01. It appears the GC9A01 has a pixel stream time-out that stops new pixels in a started stream from being rendered. No other supported display behaves this way! This is a GC9A01 specific patch.
This commit is contained in:
34
TFT_eSPI.cpp
34
TFT_eSPI.cpp
@ -4464,16 +4464,25 @@ void TFT_eSPI::drawWedgeLine(float ax, float ay, float bx, float by, float ar, f
|
||||
// Track edge to minimise calculations
|
||||
if (!endX) { endX = true; xs = xp; }
|
||||
if (alpha > HiAlphaTheshold) {
|
||||
if (swin) { setWindow(xp, yp, width()-1, yp); swin = false; }
|
||||
pushColor(fg_color);
|
||||
#ifdef GC9A01_DRIVER
|
||||
drawPixel(xp, yp, fg_color);
|
||||
#else
|
||||
if (swin) { setWindow(xp, yp, x1, yp); swin = false; }
|
||||
pushColor(fg_color);
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
//Blend color with background and plot
|
||||
if (bg_color == 0x00FFFFFF) {
|
||||
bg = readPixel(xp, yp); swin = true;
|
||||
}
|
||||
if (swin) { setWindow(xp, yp, width()-1, yp); swin = false; }
|
||||
pushColor(alphaBlend((uint8_t)(alpha * PixelAlphaGain), fg_color, bg));
|
||||
#ifdef GC9A01_DRIVER
|
||||
uint16_t pcol = alphaBlend((uint8_t)(alpha * PixelAlphaGain);
|
||||
drawPixel(xp, yp, pcol, fg_color, bg));
|
||||
#else
|
||||
if (swin) { setWindow(xp, yp, x1, yp); swin = false; }
|
||||
pushColor(alphaBlend((uint8_t)(alpha * PixelAlphaGain), fg_color, bg));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -4492,16 +4501,25 @@ void TFT_eSPI::drawWedgeLine(float ax, float ay, float bx, float by, float ar, f
|
||||
// Track line boundary
|
||||
if (!endX) { endX = true; xs = xp; }
|
||||
if (alpha > HiAlphaTheshold) {
|
||||
if (swin) { setWindow(xp, yp, width()-1, yp); swin = false; }
|
||||
pushColor(fg_color);
|
||||
#ifdef GC9A01_DRIVER
|
||||
drawPixel(xp, yp, fg_color);
|
||||
#else
|
||||
if (swin) { setWindow(xp, yp, x1, yp); swin = false; }
|
||||
pushColor(fg_color);
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
//Blend colour with background and plot
|
||||
if (bg_color == 0x00FFFFFF) {
|
||||
bg = readPixel(xp, yp); swin = true;
|
||||
}
|
||||
if (swin) { setWindow(xp, yp, width()-1, yp); swin = false; }
|
||||
pushColor(alphaBlend((uint8_t)(alpha * PixelAlphaGain), fg_color, bg));
|
||||
#ifdef GC9A01_DRIVER
|
||||
uint16_t pcol = alphaBlend((uint8_t)(alpha * PixelAlphaGain);
|
||||
drawPixel(xp, yp, pcol, fg_color, bg));
|
||||
#else
|
||||
if (swin) { setWindow(xp, yp, x1, yp); swin = false; }
|
||||
pushColor(alphaBlend((uint8_t)(alpha * PixelAlphaGain), fg_color, bg));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user