Skip to content

Commit 463fc68

Browse files
authored
Merge pull request #47 from kmatch98/fix_anchoring
Updated bounding_box "right" value to include trailing whitespace
2 parents 387d67e + 713692a commit 463fc68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adafruit_display_text/label.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def _update_text(self, new_text): # pylint: disable=too-many-locals
126126
glyph = self._font.get_glyph(ord(character))
127127
if not glyph:
128128
continue
129-
right = max(right, x + glyph.width)
129+
right = max(right, x + glyph.width + glyph.shift_x)
130130
if y == 0: # first line, find the Ascender height
131131
top = min(top, -glyph.height + y_offset)
132132
bottom = max(bottom, y - glyph.dy + y_offset)

0 commit comments

Comments
 (0)