From e60b427ca2317600f1da068cbe0e40ff281547ad Mon Sep 17 00:00:00 2001 From: moononournation Date: Thu, 22 Feb 2024 23:11:50 +0800 Subject: [PATCH] minor refactor --- src/Arduino_GFX.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Arduino_GFX.cpp b/src/Arduino_GFX.cpp index 4ee4a226..3f3f42ca 100644 --- a/src/Arduino_GFX.cpp +++ b/src/Arduino_GFX.cpp @@ -2509,8 +2509,6 @@ void Arduino_GFX::setRotation(uint8_t r) case 1: _width = HEIGHT; _height = WIDTH; - _max_x = _width - 1; ///< x zero base bound - _max_y = _height - 1; ///< y zero base bound break; case 6: case 4: @@ -2518,11 +2516,12 @@ void Arduino_GFX::setRotation(uint8_t r) default: // case 0: _width = WIDTH; _height = HEIGHT; - _max_x = _width - 1; ///< x zero base bound - _max_y = _height - 1; ///< y zero base bound break; } + _max_x = _width - 1; ///< x zero base bound + _max_y = _height - 1; ///< y zero base bound + // reset textBound after setRotation() setTextBound(0, 0, _width, _height); }