Skip to content

Commit 1f27ba7

Browse files
authored
Merge pull request #152 from jposada202020/correcting_bitmaplabel_anchorpoint
correcting_anchor_point for bitmap_label Upwards and Downwards direction
2 parents 0823112 + 3e45a36 commit 1f27ba7

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

adafruit_display_text/bitmap_label.py

+14-6
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,20 @@ def _reset_text(
299299

300300
# Update bounding_box values. Note: To be consistent with label.py,
301301
# this is the bounding box for the text only, not including the background.
302-
self._bounding_box = (
303-
self.tilegrid.x,
304-
self.tilegrid.y,
305-
box_x,
306-
tight_box_y,
307-
)
302+
if label_direction == "UPR" or self._label_direction == "DWR":
303+
self._bounding_box = (
304+
self.tilegrid.x,
305+
self.tilegrid.y,
306+
tight_box_y,
307+
box_x,
308+
)
309+
else:
310+
self._bounding_box = (
311+
self.tilegrid.x,
312+
self.tilegrid.y,
313+
box_x,
314+
tight_box_y,
315+
)
308316

309317
if (
310318
scale is not None

0 commit comments

Comments
 (0)