1
0
mirror of https://github.com/esphome/esphome.git synced 2025-04-08 03:40:28 +01:00

[display] Don't assume glyph x_offset is zero. (#8473)

This commit is contained in:
Clyde Stubbs 2025-03-27 11:31:55 +11:00 committed by Keith Burzinski
parent 573088aadb
commit 57a57f0d6a
No known key found for this signature in database
GPG Key ID: 802564C5F0EEFFBE

View File

@ -555,10 +555,10 @@ void Display::get_text_bounds(int x, int y, const char *text, BaseFont *font, Te
switch (x_align) {
case TextAlign::RIGHT:
*x1 = x - *width;
*x1 = x - *width - x_offset;
break;
case TextAlign::CENTER_HORIZONTAL:
*x1 = x - (*width) / 2;
*x1 = x - (*width + x_offset) / 2;
break;
case TextAlign::LEFT:
default: