Skip to content

Commit 2d65dc0

Browse files
author
Margaret Matocha
committed
Reverted a half-updated function for background bitmap management
1 parent 631d044 commit 2d65dc0

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

adafruit_display_text/label.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,14 @@ def _create_background_box(self, lines, y_offset):
164164
box_width = max(0, box_width) # remove any negative values
165165
box_height = max(0, box_height) # remove any negative values
166166

167-
if box_width > 0 and box_height > 0:
168-
background_bitmap = displayio.Bitmap(box_width, box_height, 1)
169-
tile_grid = displayio.TileGrid(
170-
background_bitmap,
171-
pixel_shader=self._background_palette,
172-
x=left + x_box_offset,
173-
y=y_box_offset,
174-
)
175-
return tile_grid
176-
else:
177-
return None
167+
background_bitmap = displayio.Bitmap(box_width, box_height, 1)
168+
tile_grid = displayio.TileGrid(
169+
background_bitmap,
170+
pixel_shader=self._background_palette,
171+
x=left + x_box_offset,
172+
y=y_box_offset,
173+
)
174+
return tile_grid
178175

179176
def _update_background_color(self, new_color):
180177

0 commit comments

Comments
 (0)