Skip to content

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

Merged
merged 3 commits into from
Jul 1, 2021
Merged

Remove max_size parameter #153

merged 3 commits into from
Jul 1, 2021

Conversation

lesamouraipourpre
Copy link
Contributor

Closes #131

Remove the max_size parameter from Label and BitmapLabel now that it has been disabled in shared-bindings.

This has been tested with:

Adafruit CircuitPython 6.3.0 on 2021-06-01; Adafruit PyPortal with samd51j20

@@ -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")
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

@FoamyGuy FoamyGuy left a 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.

@FoamyGuy FoamyGuy merged commit 5b0c5fe into adafruit:main Jul 1, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jul 2, 2021
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
@lesamouraipourpre lesamouraipourpre deleted the max-size branch July 2, 2021 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Try to remove max_glyphs restriction from label
2 participants