Skip to content

Commit bb79810

Browse files
author
Margaret Matocha
committed
Updated font.height and ran black formatter
1 parent 756088b commit bb79810

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

adafruit_display_text/label.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ def _update_text(self, new_text): # pylint: disable=too-many-locals
100100
y = 0
101101
i = 0
102102
old_c = 0
103-
bounds = self._font.get_bounding_box() # moved here ***
104-
self.height = bounds[1] # moved here ***
105103
y_offset = int(
106104
(
107105
self._font.get_glyph(ord("M")).height
@@ -238,9 +236,11 @@ def font(self):
238236

239237
@font.setter
240238
def font(self, newFont):
241-
old_text=self._text
242-
self._text=''
243-
self._font=newFont
239+
old_text = self._text
240+
self._text = ""
241+
self._font = newFont
242+
bounds = self._font.get_bounding_box()
243+
self.height = bounds[1]
244244
self._update_text(str(old_text))
245245

246246
@property

0 commit comments

Comments
 (0)