adafruit / Adafruit_CircuitPython_DisplayIO_Layout

A Circuitpython helper library for display element layout using displayio.
MIT License
10 stars 14 forks source link

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

Closed FoamyGuy closed 3 years ago

FoamyGuy commented 3 years ago

This fixes the issue noted here: https://github.com/adafruit/Adafruit_CircuitPython_MacroPad/issues/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.