Skip to content

fix for content elements that dont allow setting width and height #42

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 1 commit into from
Jul 24, 2021

Conversation

FoamyGuy
Copy link
Contributor

This fixes the issue noted here: adafruit/Adafruit_CircuitPython_MacroPad#10

Label and BitmapLabel do not allow setting arbitrary width and height values. So we catch the exception and just use the size that the label already is.

In the past Label and BitmapLabel had width and height class variables so those got set from GridLayout but did not actually change the visual appearance of the label. So catching this exception results in the exact behavior that we had previously.

Copy link
Contributor

@lesamouraipourpre lesamouraipourpre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Tested on a PyPortal Pynt with 7.0.0-alpha.5
Examples used:
DisplayIO_Layout/examples/displayio_layout_gridlayout_simpletest.py
MacroPad/examples/macropad_grid_layout.py (adapted to run on a PyPortal and simulate random key presses)

@FoamyGuy FoamyGuy merged commit cb263f1 into adafruit:main Jul 24, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jul 25, 2021
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.

2 participants