mirror of
https://github.com/esphome/esphome.git
synced 2025-04-14 04:29:05 +02:00
[display] Don't assume glyph x_offset is zero. (#8473)
This commit is contained in:
parent
4bb59ce1d1
commit
ccd55a8e84
1 changed files with 2 additions and 2 deletions
|
@ -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…
Add table
Reference in a new issue