mirror of
https://github.com/esphome/esphome.git
synced 2025-09-02 19:32:19 +01:00
[display] Don't assume glyph x_offset is zero. (#8473)
This commit is contained in:
@@ -555,10 +555,10 @@ void Display::get_text_bounds(int x, int y, const char *text, BaseFont *font, Te
|
|||||||
|
|
||||||
switch (x_align) {
|
switch (x_align) {
|
||||||
case TextAlign::RIGHT:
|
case TextAlign::RIGHT:
|
||||||
*x1 = x - *width;
|
*x1 = x - *width - x_offset;
|
||||||
break;
|
break;
|
||||||
case TextAlign::CENTER_HORIZONTAL:
|
case TextAlign::CENTER_HORIZONTAL:
|
||||||
*x1 = x - (*width) / 2;
|
*x1 = x - (*width + x_offset) / 2;
|
||||||
break;
|
break;
|
||||||
case TextAlign::LEFT:
|
case TextAlign::LEFT:
|
||||||
default:
|
default:
|
||||||
|
Reference in New Issue
Block a user