Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions adafruit_display_text/bitmap_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def _text_bounding_box(
lines += 1
if xposition == x_start:
if left is None:
left = my_glyph.dx
left = 0
else:
left = min(left, my_glyph.dx)
xright = xposition + my_glyph.width + my_glyph.dx
Expand Down Expand Up @@ -392,7 +392,7 @@ def _place_text(
else:
if xposition == x_start:
if left is None:
left = my_glyph.dx
left = 0
else:
left = min(left, my_glyph.dx)

Expand Down
6 changes: 3 additions & 3 deletions adafruit_display_text/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def _update_text(self, new_text: str) -> None:
right = max(right, x + glyph.shift_x, x + glyph.width + glyph.dx)
if x == 0:
if left is None:
left = glyph.dx
left = 0
else:
left = min(left, glyph.dx)
position_x = x + glyph.dx
Expand All @@ -281,15 +281,15 @@ def _update_text(self, new_text: str) -> None:
)
if x == 0:
if right is None:
right = glyph.dx
right = 0
else:
right = max(right, glyph.dx)
position_x = x - glyph.width

elif self._label_direction == "TTB":
if x == 0:
if left is None:
left = glyph.dx
left = 0
else:
left = min(left, glyph.dx)
if y == 0:
Expand Down