mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2024-09-21 10:27:11 +00:00
Fix bug #122 by different approach
This commit is contained in:
parent
3945a9776d
commit
4d181d7a19
@ -4115,9 +4115,9 @@ int16_t TFT_eSPI::drawString(const char *string, int poX, int poY, int font)
|
||||
}
|
||||
// Check coordinates are OK, adjust if not
|
||||
if (poX < 0) poX = 0;
|
||||
if (poX+cwidth>_width) poX = _width - cwidth;
|
||||
if (poX+cwidth > width()) poX = width() - cwidth;
|
||||
if (poY < 0) poY = 0;
|
||||
if (poY+cheight-baseline>_height) poY = _height - cheight;
|
||||
if (poY+cheight-baseline> height()) poY = height() - cheight;
|
||||
}
|
||||
|
||||
|
||||
|
@ -471,7 +471,9 @@ class TFT_eSPI : public Print {
|
||||
fillRect(int32_t x, int32_t y, int32_t w, int32_t h, uint32_t color);
|
||||
|
||||
virtual int16_t drawChar(unsigned int uniCode, int x, int y, int font),
|
||||
drawChar(unsigned int uniCode, int x, int y);
|
||||
drawChar(unsigned int uniCode, int x, int y),
|
||||
height(void),
|
||||
width(void);
|
||||
|
||||
// The TFT_eSprite class inherits the following functions
|
||||
void setWindow(int16_t x0, int16_t y0, int16_t x1, int16_t y1),
|
||||
@ -588,9 +590,7 @@ class TFT_eSPI : public Print {
|
||||
drawCentreString(const String& string, int dX, int poY, int font), // Deprecated, use setTextDatum() and drawString()
|
||||
drawRightString(const String& string, int dX, int poY, int font); // Deprecated, use setTextDatum() and drawString()
|
||||
|
||||
int16_t height(void),
|
||||
width(void),
|
||||
textWidth(const char *string, int font),
|
||||
int16_t textWidth(const char *string, int font),
|
||||
textWidth(const char *string),
|
||||
textWidth(const String& string, int font),
|
||||
textWidth(const String& string),
|
||||
|
Loading…
Reference in New Issue
Block a user