-
Notifications
You must be signed in to change notification settings - Fork 38
Remove max_size parameter #153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -81,18 +81,15 @@ def __init__(self, font, **kwargs) -> None: | |||
text = kwargs.get("text", "") | |||
|
|||
if not max_glyphs and not text: | |||
raise RuntimeError("Please provide a max size, or initial text") | |||
raise RuntimeError("Please provide a max_glyphs, or initial text") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we may be able to get rid of max_glyphs
. if I understand correctly, the reason for that restriction and parameter was the underlying Group's max_size
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's assigned to width further down so I didn't want to mess with it for now.
self.width = max_glyphs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I'll test out this change as-is, we can merge it now if good and then remove it in a followup.
it seems odd that it would use that for width without multiplying by the width of the glyph in pixels. I can poke into it a bit and try to figure out if it's needed or how to replace it with something different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes look good to me. I tested successfully a handful of the examples on a PyPortal with CircuitPython 6.3.0 and 7.0.0.beta-3.
Updating https://github.com/adafruit/Adafruit_CircuitPython_OV2640 to 1.0.1 from 1.0.0: > Merge pull request adafruit/Adafruit_CircuitPython_OV2640#3 from adafruit/ulab-example Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1306 to 2.12.0 from 2.11.6: > Merge pull request adafruit/Adafruit_CircuitPython_SSD1306#66 from mcauser/patch Updating https://github.com/adafruit/Adafruit_CircuitPython_TCS34725 to 3.3.8 from 3.3.7: > Merge pull request adafruit/Adafruit_CircuitPython_TCS34725#37 from silviaCC/simpletest_and_color_rgb_update > Moved default branch to main > Moved CI to Python 3.7 > Added help text and problem matcher > Added pull request template Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 2.18.6 from 2.18.5: > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#153 from lesamouraipourpre/max-size Updating https://github.com/adafruit/Adafruit_CircuitPython_Simple_Text_Display to 1.0.2 from 1.0.1: > Merge pull request adafruit/Adafruit_CircuitPython_Simple_Text_Display#2 from kattni/pypi Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Added the following libraries: Adafruit_CircuitPython_Simple_Text_Display
Closes #131
Remove the
max_size
parameter fromLabel
andBitmapLabel
now that it has been disabled inshared-bindings
.This has been tested with: