Skip to content

Commit 4bdfb61

Browse files
author
Margaret Matocha
committed
Ran black
1 parent 9ffd22a commit 4bdfb61

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

adafruit_display_text/bitmap_label.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949

5050
import displayio
5151

52+
5253
class Label(displayio.Group):
5354

5455
# Class variable
@@ -161,7 +162,7 @@ def __init__(
161162
y=label_position_yoffset - y_offset - padding_top,
162163
)
163164

164-
# instance the Group
165+
# instance the Group
165166
# this Group will contain just one TileGrid with one contained bitmap
166167
super().__init__(
167168
max_size=1, x=x, y=y, **kwargs
@@ -190,12 +191,15 @@ def line_spacing_ypixels(font, line_spacing):
190191
return_value = int(line_spacing * font.get_bounding_box()[1])
191192
return return_value
192193

193-
def text_bounding_box(self,
194-
text, font, line_spacing, background_tight=False
194+
def text_bounding_box(
195+
self, text, font, line_spacing, background_tight=False
195196
): # **** change default background_tight=False
196197

197198
label_position_yoffset = int( # for calibration with label.py positioning
198-
(font.get_glyph(ord("M")).height - font.get_bounding_box()[1] * line_spacing)
199+
(
200+
font.get_glyph(ord("M")).height
201+
- font.get_bounding_box()[1] * line_spacing
202+
)
199203
/ 2
200204
)
201205

@@ -285,7 +289,8 @@ def text_bounding_box(self,
285289

286290
return (final_box_width, final_box_height, 0, final_y_offset)
287291

288-
def place_text(self,
292+
def place_text(
293+
self,
289294
bitmap,
290295
text,
291296
font,
@@ -386,8 +391,6 @@ def place_text(self,
386391

387392
return (left, top, right - left, bottom - top) # bounding_box
388393

389-
390-
391394
@property
392395
def anchor_point(self):
393396
"""Point that anchored_position moves relative to.

0 commit comments

Comments
 (0)