From d9694ef50dd7bd1b49908532bbff7738a80630b7 Mon Sep 17 00:00:00 2001 From: Bodmer Date: Mon, 22 May 2017 23:43:26 +0100 Subject: [PATCH] Correct textwrap limit (Issue #18) --- TFT_eSPI.cpp | 4 ++-- library.json | 2 +- library.properties | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TFT_eSPI.cpp b/TFT_eSPI.cpp index 9699949..1ea057c 100644 --- a/TFT_eSPI.cpp +++ b/TFT_eSPI.cpp @@ -2773,7 +2773,7 @@ size_t TFT_eSPI::write(uint8_t utf8) } else { - if (textwrap && (cursor_x + width * textsize >= _width)) + if (textwrap && (cursor_x + width * textsize > _width)) { cursor_y += height; cursor_x = 0; @@ -2801,7 +2801,7 @@ size_t TFT_eSPI::write(uint8_t utf8) h = pgm_read_byte(&glyph->height); if((w > 0) && (h > 0)) { // Is there an associated bitmap? 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 cursor_x = 0; cursor_y += (int16_t)textsize * diff --git a/library.json b/library.json index f6d09c3..a3434bc 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "TFT_eSPI", - "version": "0.16.9", + "version": "0.16.10", "keywords": "TFT, ESP8266, NodeMCU, ILI9341, ST7735, ILI9163, S6D02A1, ILI9486", "description": "A TFT SPI graphics library for ESP8266", "repository": diff --git a/library.properties b/library.properties index 84c6367..0afedbe 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=TFT_eSPI -version=0.16.9 +version=0.16.10 author=Bodmer maintainer=Bodmer sentence=A fast TFT library for ESP8266 processors and the Arduino IDE