Skip to content

Commit

Permalink
Run pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tekktrik committed May 11, 2023
1 parent 85db2df commit a11aab7
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 12 deletions.
8 changes: 0 additions & 8 deletions adafruit_display_text/bitmap_label.py
Expand Up @@ -95,7 +95,6 @@ class Label(LabelBase):
}

def __init__(self, font: FontProtocol, save_text: bool = True, **kwargs) -> None:

self._bitmap = None
self._tilegrid = None
self._prev_label_direction = None
Expand Down Expand Up @@ -141,7 +140,6 @@ def _reset_text(
if (text == "") or (
text is None
): # If empty string, just create a zero-sized bounding box and that's it.

self._bounding_box = (
0,
0,
Expand Down Expand Up @@ -304,12 +302,10 @@ def _text_bounding_box(
line_spacing = self._line_spacing

for char in text:

if char == "\n": # newline
newlines += 1

else:

my_glyph = font.get_glyph(ord(char))

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

for char in text:

if char == "\n": # newline
xposition = x_start # reset to left column
yposition = yposition + self._line_spacing_ypixels(
font, line_spacing
) # Add a newline

else:

my_glyph = font.get_glyph(ord(char))

if my_glyph is None: # Error checking: no glyph found
Expand Down Expand Up @@ -490,7 +484,6 @@ def _blit(
)

else: # perform pixel by pixel copy of the bitmap

# Perform input checks

if x_2 is None:
Expand All @@ -516,7 +509,6 @@ def _blit(
if (bitmap.width > x_placement >= 0) and (
bitmap.height > y_placement >= 0
): # ensure placement is within target bitmap

# get the palette index from the source bitmap
this_pixel_color = source_bitmap[
y_1
Expand Down
1 change: 0 additions & 1 deletion adafruit_display_text/label.py
Expand Up @@ -161,7 +161,6 @@ def _create_background_box(self, lines: int, y_offset: int) -> TileGrid:
if self._base_alignment:
y_box_offset = -ascent - padding_to_use
else:

y_box_offset = -ascent + y_offset - padding_to_use

box_width = max(0, box_width) # remove any negative values
Expand Down
2 changes: 0 additions & 2 deletions adafruit_display_text/scrolling_label.py
Expand Up @@ -60,7 +60,6 @@ def __init__(
current_index: Optional[int] = 0,
**kwargs
) -> None:

super().__init__(font, **kwargs)
self.animate_time = animate_time
self._current_index = current_index
Expand All @@ -84,7 +83,6 @@ def update(self, force: bool = False) -> None:
"""
_now = time.monotonic()
if force or self._last_animate_time + self.animate_time <= _now:

if len(self.full_text) <= self.max_characters:
super()._set_text(self.full_text, self.scale)
self._last_animate_time = _now
Expand Down
1 change: 0 additions & 1 deletion examples/display_text_label_vs_bitmap_label_comparison.py
Expand Up @@ -99,7 +99,6 @@
# preloading the glyphs will help speed up the rendering of text but will use more RAM

if preload_glyphs and not use_builtinfont:

# identify the glyphs to load into memory -> increases rendering speed
glyphs = (
b"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/-_,.:?!'\n "
Expand Down

0 comments on commit a11aab7

Please sign in to comment.