Skip to content

Commit 5b0c5fe

Browse files
authored
Merge pull request #153 from lesamouraipourpre/max-size
Remove max_size parameter
2 parents 1f27ba7 + 6249703 commit 5b0c5fe

10 files changed

+12
-14
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ repos:
2828
hooks:
2929
- id: pylint_examples
3030
name: pylint (examples code)
31+
require_serial: true
3132
description: Run pylint rules on "examples/*.py" files
3233
entry: /usr/bin/env bash -c
3334
args: ['([[ ! -d "examples" ]] || for example in $(find . -path "./examples/*.py"); do pylint --disable=missing-docstring,invalid-name $example; done)']

adafruit_display_text/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def __init__(
217217
label_direction: str = "LTR",
218218
**kwargs,
219219
) -> None:
220-
super().__init__(max_size=1, x=x, y=y, scale=1, **kwargs)
220+
super().__init__(x=x, y=y, scale=1)
221221

222222
self._font = font
223223
self._ascent, self._descent = self._get_ascent_descent()

adafruit_display_text/bitmap_label.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def __init__(self, font, **kwargs) -> None:
9191
super().__init__(font, **kwargs)
9292

9393
self.local_group = displayio.Group(
94-
max_size=1, scale=kwargs.get("scale", 1)
94+
scale=kwargs.get("scale", 1)
9595
) # local_group holds the tileGrid and sets the scaling
9696
self.append(
9797
self.local_group

adafruit_display_text/label.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,15 @@ def __init__(self, font, **kwargs) -> None:
8181
text = kwargs.get("text", "")
8282

8383
if not max_glyphs and not text:
84-
raise RuntimeError("Please provide a max size, or initial text")
84+
raise RuntimeError("Please provide a max_glyphs, or initial text")
8585
self._tab_replacement = kwargs.get("tab_replacement", (4, " "))
8686
self._tab_text = self._tab_replacement[1] * self._tab_replacement[0]
8787
text = self._tab_text.join(text.split("\t"))
8888
if not max_glyphs:
8989
max_glyphs = len(text)
90-
# add one to max_size for the background bitmap tileGrid
9190

9291
# local_group will set the scale
93-
self.local_group = displayio.Group(
94-
max_size=max_glyphs + 1, scale=kwargs.get("scale", 1)
95-
)
92+
self.local_group = displayio.Group(scale=kwargs.get("scale", 1))
9693
self.append(self.local_group)
9794

9895
self.width = max_glyphs

examples/display_text_advance_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from adafruit_bitmap_font import bitmap_font
1616

1717
display = board.DISPLAY
18-
main_group = displayio.Group(max_size=10)
18+
main_group = displayio.Group()
1919
MEDIUM_FONT = bitmap_font.load_font("fonts/LeagueSpartan-Bold-16.bdf")
2020
BIG_FONT = bitmap_font.load_font("fonts/LibreBodoniv2002-Bold-27.bdf")
2121
TIME_PAUSE = 2

examples/display_text_anchored_position.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
text_area_bottom_right.anchor_point = (1.0, 1.0)
5050
text_area_bottom_right.anchored_position = (DISPLAY_WIDTH, DISPLAY_HEIGHT)
5151

52-
text_group = displayio.Group(max_size=9)
52+
text_group = displayio.Group()
5353
text_group.append(text_area_top_middle)
5454
text_group.append(text_area_top_left)
5555
text_group.append(text_area_top_right)

examples/display_text_background_color_padding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
text.append("MONSTER quops\nnewline quops") # with newline
8282

8383
display.auto_refresh = True
84-
myGroup = displayio.Group(max_size=6)
84+
myGroup = displayio.Group()
8585
display.show(myGroup)
8686

8787
text_area = []

examples/display_text_label_vs_bitmap_label_comparison.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161

162162
print("bitmap_label used: {} memory".format(bitmap_label_start - bitmap_label_end))
163163

164-
bmap_group = displayio.Group(max_size=4) # Create a group for displaying
164+
bmap_group = displayio.Group() # Create a group for displaying
165165
bmap_group.append(bmap_label1)
166166
bmap_group.append(bmap_label2)
167167

@@ -209,7 +209,7 @@
209209
label_end = gc.mem_free()
210210

211211
print("label used: {} memory".format(label_start - label_end))
212-
label_group = displayio.Group(max_size=4) # Create a group for displaying
212+
label_group = displayio.Group() # Create a group for displaying
213213
label_group.append(label1)
214214
label_group.append(label2)
215215

examples/display_text_pyportal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
demos = ["CircuitPython = Code + Community", "accents - üàêùéáçãÍóí", "others - αψ◌"]
2929

30-
splash = displayio.Group(max_size=len(fonts) * len(demos))
30+
splash = displayio.Group()
3131
board.DISPLAY.show(splash)
3232
max_y = 0
3333
y = 2

examples/display_text_wrap_pixels_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
display = board.DISPLAY
2525

2626
# Make the display context
27-
main_group = displayio.Group(max_size=10)
27+
main_group = displayio.Group()
2828
display.show(main_group)
2929

3030
font = terminalio.FONT

0 commit comments

Comments
 (0)