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
|
|
@ -94,6 +94,13 @@ void GxEPDDisplay::drawXbm(int x, int y, const uint8_t* bits, int w, int h) {
|
|||
display.drawBitmap(x*1.5, (y*1.5) + 10, bits, w, h, GxEPD_BLACK);
|
||||
}
|
||||
|
||||
uint16_t GxEPDDisplay::getTextWidth(const char* str) {
|
||||
int16_t x1, y1;
|
||||
uint16_t w, h;
|
||||
display.getTextBounds(str, 0, 0, &x1, &y1, &w, &h);
|
||||
return w;
|
||||
}
|
||||
|
||||
void GxEPDDisplay::endFrame() {
|
||||
display.display(true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue