Skip to content

Commit 05affa4

Browse files
author
Margaret Matocha
committed
ran black
1 parent f106d48 commit 05affa4

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

adafruit_display_text/label.py

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -190,23 +190,35 @@ def _update_background_color(self, new_color):
190190
)
191191
lines = self.text.count("\n") + 1
192192

193-
if not self._added_background_tilegrid: # no bitmap is in the self Group
193+
if not self._added_background_tilegrid: # no bitmap is in the self Group
194194
# add bitmap if text is present and bitmap sizes > 0 pixels
195-
if ((len(self._text) > 0)
196-
and (self._boundingbox[2] + self._padding_left + self._padding_right > 0)
197-
and (self._boundingbox[3] + self._padding_top + self._padding_bottom > 0)):
195+
if (
196+
(len(self._text) > 0)
197+
and (
198+
self._boundingbox[2] + self._padding_left + self._padding_right > 0
199+
)
200+
and (
201+
self._boundingbox[3] + self._padding_top + self._padding_bottom > 0
202+
)
203+
):
198204
if len(self) > 0:
199205
self.insert(0, self._create_background_box(lines, y_offset))
200206
else:
201207
self.append(self._create_background_box(lines, y_offset))
202208
self._added_background_tilegrid = True
203-
else: # a bitmap is present in the self Group
209+
else: # a bitmap is present in the self Group
204210
# update bitmap if text is present and bitmap sizes > 0 pixels
205-
if ((len(self._text) > 0)
206-
and (self._boundingbox[2] + self._padding_left + self._padding_right > 0)
207-
and (self._boundingbox[3] + self._padding_top + self._padding_bottom > 0)):
211+
if (
212+
(len(self._text) > 0)
213+
and (
214+
self._boundingbox[2] + self._padding_left + self._padding_right > 0
215+
)
216+
and (
217+
self._boundingbox[3] + self._padding_top + self._padding_bottom > 0
218+
)
219+
):
208220
self[0] = self._create_background_box(lines, y_offset)
209-
else: # delete the existing bitmap
221+
else: # delete the existing bitmap
210222
self.pop(0)
211223
self._added_background_tilegrid = False
212224

0 commit comments

Comments
 (0)