Skip to content

Commit a11aab7

Browse files
committed
Run pre-commit
1 parent 85db2df commit a11aab7

File tree

4 files changed

+0
-12
lines changed

4 files changed

+0
-12
lines changed

adafruit_display_text/bitmap_label.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ class Label(LabelBase):
9595
}
9696

9797
def __init__(self, font: FontProtocol, save_text: bool = True, **kwargs) -> None:
98-
9998
self._bitmap = None
10099
self._tilegrid = None
101100
self._prev_label_direction = None
@@ -141,7 +140,6 @@ def _reset_text(
141140
if (text == "") or (
142141
text is None
143142
): # If empty string, just create a zero-sized bounding box and that's it.
144-
145143
self._bounding_box = (
146144
0,
147145
0,
@@ -304,12 +302,10 @@ def _text_bounding_box(
304302
line_spacing = self._line_spacing
305303

306304
for char in text:
307-
308305
if char == "\n": # newline
309306
newlines += 1
310307

311308
else:
312-
313309
my_glyph = font.get_glyph(ord(char))
314310

315311
if my_glyph is None: # Error checking: no glyph found
@@ -387,15 +383,13 @@ def _place_text(
387383
line_spacing = self._line_spacing
388384

389385
for char in text:
390-
391386
if char == "\n": # newline
392387
xposition = x_start # reset to left column
393388
yposition = yposition + self._line_spacing_ypixels(
394389
font, line_spacing
395390
) # Add a newline
396391

397392
else:
398-
399393
my_glyph = font.get_glyph(ord(char))
400394

401395
if my_glyph is None: # Error checking: no glyph found
@@ -490,7 +484,6 @@ def _blit(
490484
)
491485

492486
else: # perform pixel by pixel copy of the bitmap
493-
494487
# Perform input checks
495488

496489
if x_2 is None:
@@ -516,7 +509,6 @@ def _blit(
516509
if (bitmap.width > x_placement >= 0) and (
517510
bitmap.height > y_placement >= 0
518511
): # ensure placement is within target bitmap
519-
520512
# get the palette index from the source bitmap
521513
this_pixel_color = source_bitmap[
522514
y_1

adafruit_display_text/label.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ def _create_background_box(self, lines: int, y_offset: int) -> TileGrid:
161161
if self._base_alignment:
162162
y_box_offset = -ascent - padding_to_use
163163
else:
164-
165164
y_box_offset = -ascent + y_offset - padding_to_use
166165

167166
box_width = max(0, box_width) # remove any negative values

adafruit_display_text/scrolling_label.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ def __init__(
6060
current_index: Optional[int] = 0,
6161
**kwargs
6262
) -> None:
63-
6463
super().__init__(font, **kwargs)
6564
self.animate_time = animate_time
6665
self._current_index = current_index
@@ -84,7 +83,6 @@ def update(self, force: bool = False) -> None:
8483
"""
8584
_now = time.monotonic()
8685
if force or self._last_animate_time + self.animate_time <= _now:
87-
8886
if len(self.full_text) <= self.max_characters:
8987
super()._set_text(self.full_text, self.scale)
9088
self._last_animate_time = _now

examples/display_text_label_vs_bitmap_label_comparison.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@
9999
# preloading the glyphs will help speed up the rendering of text but will use more RAM
100100

101101
if preload_glyphs and not use_builtinfont:
102-
103102
# identify the glyphs to load into memory -> increases rendering speed
104103
glyphs = (
105104
b"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/-_,.:?!'\n "

0 commit comments

Comments
 (0)