Add width() and height() for NO_GFX

add int16_t width() and int16_t height(), when NO_GFX is enabled. 
you also could get the dimesions the following way
height = matrix.getCfg().mx_height;
width = matrix.getCfg().mx_width * matrix.getCfg().chain_length;

but I think the new funktions are simpler
This commit is contained in:
Lukaswnd 2024-01-18 12:33:38 +01:00 committed by GitHub
parent 692078352e
commit 75e9478e7f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -571,6 +571,11 @@ public:
void drawPixel(int16_t x, int16_t y, CRGB color);
#endif
#ifdef NO_GFX
inline int16_t width() const { return m_cfg.mx_width * m_cfg.chain_length; }
inline int16_t height() const { return m_cfg.mx_height; }
#endif
void drawIcon(int *ico, int16_t x, int16_t y, int16_t cols, int16_t rows);
// Colour 444 is a 4 bit scale, so 0 to 15, colour 565 takes a 0-255 bit value, so scale up by 255/15 (i.e. 17)!