mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2025-08-07 06:34:44 +02:00
Fix bug #122 by different approach
This commit is contained in:
@@ -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
|
// Check coordinates are OK, adjust if not
|
||||||
if (poX < 0) poX = 0;
|
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 < 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);
|
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),
|
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
|
// The TFT_eSprite class inherits the following functions
|
||||||
void setWindow(int16_t x0, int16_t y0, int16_t x1, int16_t y1),
|
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()
|
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()
|
drawRightString(const String& string, int dX, int poY, int font); // Deprecated, use setTextDatum() and drawString()
|
||||||
|
|
||||||
int16_t height(void),
|
int16_t textWidth(const char *string, int font),
|
||||||
width(void),
|
|
||||||
textWidth(const char *string, int font),
|
|
||||||
textWidth(const char *string),
|
textWidth(const char *string),
|
||||||
textWidth(const String& string, int font),
|
textWidth(const String& string, int font),
|
||||||
textWidth(const String& string),
|
textWidth(const String& string),
|
||||||
|
Reference in New Issue
Block a user