From 3e45a36c1eb0e835d2e8ccb1e904b6d43aaf2686 Mon Sep 17 00:00:00 2001 From: jposada202020 Date: Sun, 13 Jun 2021 12:54:19 -0400 Subject: [PATCH] correcting_anchor_point --- adafruit_display_text/bitmap_label.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/adafruit_display_text/bitmap_label.py b/adafruit_display_text/bitmap_label.py index 1cfaaaa..445c332 100755 --- a/adafruit_display_text/bitmap_label.py +++ b/adafruit_display_text/bitmap_label.py @@ -299,12 +299,20 @@ def _reset_text( # Update bounding_box values. Note: To be consistent with label.py, # this is the bounding box for the text only, not including the background. - self._bounding_box = ( - self.tilegrid.x, - self.tilegrid.y, - box_x, - tight_box_y, - ) + if label_direction == "UPR" or self._label_direction == "DWR": + self._bounding_box = ( + self.tilegrid.x, + self.tilegrid.y, + tight_box_y, + box_x, + ) + else: + self._bounding_box = ( + self.tilegrid.x, + self.tilegrid.y, + box_x, + tight_box_y, + ) if ( scale is not None