From bad46741ae8e83465ddabbdd6017a9dc147b2ff2 Mon Sep 17 00:00:00 2001 From: Marc Sibert Date: Sat, 22 Jun 2024 22:08:17 +0200 Subject: [PATCH 1/2] Ellipse coordinates in int32_t Change x & y coordinates (and color) from int16_t to int32_t as for circle --- TFT_eSPI.cpp | 4 ++-- TFT_eSPI.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TFT_eSPI.cpp b/TFT_eSPI.cpp index d537faeb..e4da2990 100644 --- a/TFT_eSPI.cpp +++ b/TFT_eSPI.cpp @@ -2483,7 +2483,7 @@ void TFT_eSPI::fillCircleHelper(int32_t x0, int32_t y0, int32_t r, uint8_t corne ** Function name: drawEllipse ** Description: Draw a ellipse outline ***************************************************************************************/ -void TFT_eSPI::drawEllipse(int16_t x0, int16_t y0, int32_t rx, int32_t ry, uint16_t color) +void TFT_eSPI::drawEllipse(int32_t x0, int32_t y0, int32_t rx, int32_t ry, uint32_t color) { if (rx<2) return; if (ry<2) return; @@ -2535,7 +2535,7 @@ void TFT_eSPI::drawEllipse(int16_t x0, int16_t y0, int32_t rx, int32_t ry, uint1 ** Function name: fillEllipse ** Description: draw a filled ellipse ***************************************************************************************/ -void TFT_eSPI::fillEllipse(int16_t x0, int16_t y0, int32_t rx, int32_t ry, uint16_t color) +void TFT_eSPI::fillEllipse(int32_t x0, int32_t y0, int32_t rx, int32_t ry, uint32_t color) { if (rx<2) return; if (ry<2) return; diff --git a/TFT_eSPI.h b/TFT_eSPI.h index 8ae23427..6cf3a4c7 100644 --- a/TFT_eSPI.h +++ b/TFT_eSPI.h @@ -526,8 +526,8 @@ class TFT_eSPI : public Print { friend class TFT_eSprite; // Sprite class has ac fillCircle(int32_t x, int32_t y, int32_t r, uint32_t color), fillCircleHelper(int32_t x, int32_t y, int32_t r, uint8_t cornername, int32_t delta, uint32_t color), - drawEllipse(int16_t x, int16_t y, int32_t rx, int32_t ry, uint16_t color), - fillEllipse(int16_t x, int16_t y, int32_t rx, int32_t ry, uint16_t color), + drawEllipse(int32_t x, int32_t y, int32_t rx, int32_t ry, uint32_t color), + fillEllipse(int32_t x, int32_t y, int32_t rx, int32_t ry, uint32_t color), // Corner 1 Corner 2 Corner 3 drawTriangle(int32_t x1,int32_t y1, int32_t x2,int32_t y2, int32_t x3,int32_t y3, uint32_t color), From 3ce954ca57a0f361cdfb6fb1958614550512a492 Mon Sep 17 00:00:00 2001 From: Marc Sibert Date: Sat, 6 Jul 2024 18:39:54 +0200 Subject: [PATCH 2/2] fillRectH/VGradient coordinates in int32_t Change x & y coordinates from int16_t to int32_t as the other methods --- TFT_eSPI.cpp | 4 ++-- TFT_eSPI.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TFT_eSPI.cpp b/TFT_eSPI.cpp index e4da2990..540f7f1c 100644 --- a/TFT_eSPI.cpp +++ b/TFT_eSPI.cpp @@ -4697,7 +4697,7 @@ void TFT_eSPI::fillRect(int32_t x, int32_t y, int32_t w, int32_t h, uint32_t col ** Function name: fillRectVGradient ** Description: draw a filled rectangle with a vertical colour gradient ***************************************************************************************/ -void TFT_eSPI::fillRectVGradient(int16_t x, int16_t y, int16_t w, int16_t h, uint32_t color1, uint32_t color2) +void TFT_eSPI::fillRectVGradient(int32_t x, int32_t y, int32_t w, int32_t h, uint32_t color1, uint32_t color2) { if (_vpOoB) return; @@ -4735,7 +4735,7 @@ void TFT_eSPI::fillRectVGradient(int16_t x, int16_t y, int16_t w, int16_t h, uin ** Function name: fillRectHGradient ** Description: draw a filled rectangle with a horizontal colour gradient ***************************************************************************************/ -void TFT_eSPI::fillRectHGradient(int16_t x, int16_t y, int16_t w, int16_t h, uint32_t color1, uint32_t color2) +void TFT_eSPI::fillRectHGradient(int32_t x, int32_t y, int32_t w, int32_t h, uint32_t color1, uint32_t color2) { if (_vpOoB) return; diff --git a/TFT_eSPI.h b/TFT_eSPI.h index 6cf3a4c7..9b550960 100644 --- a/TFT_eSPI.h +++ b/TFT_eSPI.h @@ -518,8 +518,8 @@ class TFT_eSPI : public Print { friend class TFT_eSprite; // Sprite class has ac drawRoundRect(int32_t x, int32_t y, int32_t w, int32_t h, int32_t radius, uint32_t color), fillRoundRect(int32_t x, int32_t y, int32_t w, int32_t h, int32_t radius, uint32_t color); - void fillRectVGradient(int16_t x, int16_t y, int16_t w, int16_t h, uint32_t color1, uint32_t color2); - void fillRectHGradient(int16_t x, int16_t y, int16_t w, int16_t h, uint32_t color1, uint32_t color2); + void fillRectVGradient(int32_t x, int32_t y, int32_t w, int32_t h, uint32_t color1, uint32_t color2); + void fillRectHGradient(int32_t x, int32_t y, int32_t w, int32_t h, uint32_t color1, uint32_t color2); void drawCircle(int32_t x, int32_t y, int32_t r, uint32_t color), drawCircleHelper(int32_t x, int32_t y, int32_t r, uint8_t cornername, uint32_t color),