Commit bdcbca43 authored by Bodmer's avatar Bodmer

Fix ePaper 1bpp width bug

parent 235887d8
...@@ -33,7 +33,7 @@ TFT_eSprite::TFT_eSprite(TFT_eSPI *tft) ...@@ -33,7 +33,7 @@ TFT_eSprite::TFT_eSprite(TFT_eSPI *tft)
_xptr = 0; // pushColor coordinate _xptr = 0; // pushColor coordinate
_yptr = 0; _yptr = 0;
this->cursor_y = this->cursor_x = 0; // Text cursor position this->cursor_y = this->cursor_x = 0; // Text cursor position
} }
...@@ -49,7 +49,7 @@ void* TFT_eSprite::createSprite(int16_t w, int16_t h, uint8_t frames) ...@@ -49,7 +49,7 @@ void* TFT_eSprite::createSprite(int16_t w, int16_t h, uint8_t frames)
if ( w < 1 || h < 1 ) return NULL; if ( w < 1 || h < 1 ) return NULL;
_iwidth = _dwidth = w; _iwidth = _dwidth = _bitwidth = w;
_iheight = _dheight = h; _iheight = _dheight = h;
this->cursor_x = 0; this->cursor_x = 0;
...@@ -703,7 +703,7 @@ int16_t TFT_eSprite::width(void) ...@@ -703,7 +703,7 @@ int16_t TFT_eSprite::width(void)
if (_rotation == 1 || _rotation == 3) return _dheight; if (_rotation == 1 || _rotation == 3) return _dheight;
return _dwidth; return _bitwidth;
} }
...@@ -1568,6 +1568,7 @@ void TFT_eSprite::printToSprite(String string) ...@@ -1568,6 +1568,7 @@ void TFT_eSprite::printToSprite(String string)
char cbuffer[len + 1]; // Add 1 for the null char cbuffer[len + 1]; // Add 1 for the null
string.toCharArray(cbuffer, len + 1); // Add 1 for the null, otherwise characters get dropped string.toCharArray(cbuffer, len + 1); // Add 1 for the null, otherwise characters get dropped
printToSprite(cbuffer, len); printToSprite(cbuffer, len);
//printToSprite((char*)string.c_str(), string.length());
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment