Fix VirtualMatrixPanel with NO_GFX

fix Compile error, 'rotate' in void VirtualMatrixPanel::setRotation is not defined, when using NO_GFX
add int16_t width() and int16_t height(), when using NO_GFX
Otherwise you cant get the dimensions of the virtual panel
This commit is contained in:
Lukaswnd 2024-01-18 12:24:18 +01:00 committed by GitHub
parent 987ca1c87d
commit 692078352e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -124,6 +124,11 @@ public:
void drawPixel(int16_t x, int16_t y, CRGB color); void drawPixel(int16_t x, int16_t y, CRGB color);
#endif #endif
#ifdef NO_GFX
inline int16_t width() const { return _virtualResX; }
inline int16_t height() const { return _virtualResY; }
#endif
uint16_t color444(uint8_t r, uint8_t g, uint8_t b) uint16_t color444(uint8_t r, uint8_t g, uint8_t b)
{ {
return display->color444(r, g, b); return display->color444(r, g, b);
@ -479,6 +484,9 @@ inline void VirtualMatrixPanel::setRotation(uint8_t rotate)
// Change the _width and _height variables used by the underlying adafruit gfx library. // Change the _width and _height variables used by the underlying adafruit gfx library.
// Actual pixel rotation / mapping is done in the getCoords function. // Actual pixel rotation / mapping is done in the getCoords function.
#ifdef NO_GFX
int8_t rotation;
#endif
rotation = (rotate & 3); rotation = (rotate & 3);
switch (rotation) { switch (rotation) {
case 0: // nothing case 0: // nothing