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:
parent
573088aadb
commit
57a57f0d6a
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user