mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2025-08-06 14:14:44 +02:00
Correct textwrap limit (Issue #18)
This commit is contained in:
@@ -2773,7 +2773,7 @@ size_t TFT_eSPI::write(uint8_t utf8)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (textwrap && (cursor_x + width * textsize >= _width))
|
if (textwrap && (cursor_x + width * textsize > _width))
|
||||||
{
|
{
|
||||||
cursor_y += height;
|
cursor_y += height;
|
||||||
cursor_x = 0;
|
cursor_x = 0;
|
||||||
@@ -2801,7 +2801,7 @@ size_t TFT_eSPI::write(uint8_t utf8)
|
|||||||
h = pgm_read_byte(&glyph->height);
|
h = pgm_read_byte(&glyph->height);
|
||||||
if((w > 0) && (h > 0)) { // Is there an associated bitmap?
|
if((w > 0) && (h > 0)) { // Is there an associated bitmap?
|
||||||
int16_t xo = (int8_t)pgm_read_byte(&glyph->xOffset);
|
int16_t xo = (int8_t)pgm_read_byte(&glyph->xOffset);
|
||||||
if(textwrap && ((cursor_x + textsize * (xo + w)) >= _width)) {
|
if(textwrap && ((cursor_x + textsize * (xo + w)) > _width)) {
|
||||||
// Drawing character would go off right edge; wrap to new line
|
// Drawing character would go off right edge; wrap to new line
|
||||||
cursor_x = 0;
|
cursor_x = 0;
|
||||||
cursor_y += (int16_t)textsize *
|
cursor_y += (int16_t)textsize *
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "TFT_eSPI",
|
"name": "TFT_eSPI",
|
||||||
"version": "0.16.9",
|
"version": "0.16.10",
|
||||||
"keywords": "TFT, ESP8266, NodeMCU, ILI9341, ST7735, ILI9163, S6D02A1, ILI9486",
|
"keywords": "TFT, ESP8266, NodeMCU, ILI9341, ST7735, ILI9163, S6D02A1, ILI9486",
|
||||||
"description": "A TFT SPI graphics library for ESP8266",
|
"description": "A TFT SPI graphics library for ESP8266",
|
||||||
"repository":
|
"repository":
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
name=TFT_eSPI
|
name=TFT_eSPI
|
||||||
version=0.16.9
|
version=0.16.10
|
||||||
author=Bodmer
|
author=Bodmer
|
||||||
maintainer=Bodmer
|
maintainer=Bodmer
|
||||||
sentence=A fast TFT library for ESP8266 processors and the Arduino IDE
|
sentence=A fast TFT library for ESP8266 processors and the Arduino IDE
|
||||||
|
Reference in New Issue
Block a user