This commit is contained in:
gemu2015 2021-04-21 11:03:01 +02:00
parent e36c7b31cb
commit 353046f092
2 changed files with 5 additions and 6 deletions

View File

@ -1712,7 +1712,7 @@ void GFXcanvas1::drawPixel(int16_t x, int16_t y, uint16_t color) {
GFXclrBit[] = { 0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0xFE }; GFXclrBit[] = { 0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0xFE };
#endif #endif
if (buffer) { if(buffer) {
if((x < 0) || (y < 0) || (x >= _width) || (y >= _height)) return; if((x < 0) || (y < 0) || (x >= _width) || (y >= _height)) return;
int16_t t; int16_t t;
@ -1751,7 +1751,7 @@ void GFXcanvas1::drawPixel(int16_t x, int16_t y, uint16_t color) {
*/ */
/**************************************************************************/ /**************************************************************************/
void GFXcanvas1::fillScreen(uint16_t color) { void GFXcanvas1::fillScreen(uint16_t color) {
if (buffer) { if(buffer) {
uint16_t bytes = ((WIDTH + 7) / 8) * HEIGHT; uint16_t bytes = ((WIDTH + 7) / 8) * HEIGHT;
memset(buffer, color ? 0xFF : 0x00, bytes); memset(buffer, color ? 0xFF : 0x00, bytes);
} }
@ -1789,8 +1789,7 @@ GFXcanvas8::~GFXcanvas8(void) {
*/ */
/**************************************************************************/ /**************************************************************************/
void GFXcanvas8::drawPixel(int16_t x, int16_t y, uint16_t color) { void GFXcanvas8::drawPixel(int16_t x, int16_t y, uint16_t color) {
if(buffer) {
if (buffer) {
if((x < 0) || (y < 0) || (x >= _width) || (y >= _height)) return; if((x < 0) || (y < 0) || (x >= _width) || (y >= _height)) return;
int16_t t; int16_t t;
@ -1822,7 +1821,7 @@ void GFXcanvas8::drawPixel(int16_t x, int16_t y, uint16_t color) {
*/ */
/**************************************************************************/ /**************************************************************************/
void GFXcanvas8::fillScreen(uint16_t color) { void GFXcanvas8::fillScreen(uint16_t color) {
if (buffer) { if(buffer) {
memset(buffer, color, WIDTH * HEIGHT); memset(buffer, color, WIDTH * HEIGHT);
} }
} }

View File

@ -220,7 +220,7 @@ virtual void
uint16_t uint16_t
textcolor, ///< 16-bit background color for print() textcolor, ///< 16-bit background color for print()
textbgcolor; ///< 16-bit text color for print() textbgcolor; ///< 16-bit text color for print()
uint8_t *framebuffer;
protected: protected:
void void
charBounds(char c, int16_t *x, int16_t *y, charBounds(char c, int16_t *x, int16_t *y,