mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Implement getTextWidth for display classes
- Added getTextWidth method to DisplayDriver interface - Implemented getTextWidth in all display classes - Updated examples to use getTextWidth directly
This commit is contained in:
parent
e442e94e3d
commit
678f36a57b
10 changed files with 32 additions and 8 deletions
|
|
@ -11,6 +11,7 @@ class ST7789Display : public DisplayDriver {
|
|||
bool _isOn;
|
||||
uint16_t _color;
|
||||
int _x=0, _y=0;
|
||||
int _textSize=1; // Track the current text size
|
||||
|
||||
bool i2c_probe(TwoWire& wire, uint8_t addr);
|
||||
public:
|
||||
|
|
@ -31,5 +32,6 @@ public:
|
|||
void fillRect(int x, int y, int w, int h) override;
|
||||
void drawRect(int x, int y, int w, int h) override;
|
||||
void drawXbm(int x, int y, const uint8_t* bits, int w, int h) override;
|
||||
uint16_t getTextWidth(const char* str) override;
|
||||
void endFrame() override;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue