Skip to content

add height and width properties for Rect and RoundRect #44

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
Nov 27, 2021

Conversation

FoamyGuy
Copy link

This adds height and width properties to Rect and RoundRect which are helpful when trying to center the shape inside of some other "box". For example with this change and a new feature I'm working on in GridLayout you'll be able to add shapes to the GridLayout and anchor them within the cells however you'd like. i.e.:

image

All testing was preformed using Blinka_DisplayIO. Definitely would appreciate if someone can test on a micro-controller with display connected.

Copy link

@kmatch98 kmatch98 left a comment

Choose a reason for hiding this comment

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

Makes sense to add two properties that can be queried to get the dimensions of a shape.

@kmatch98 kmatch98 merged commit bafa35c into adafruit:main Nov 27, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Nov 30, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_VL6180X to 1.3.0 from 1.2.8:
  > Merge pull request adafruit/Adafruit_CircuitPython_VL6180X#22 from tekktrik/feature/add-manual-offset
  > update rtd py version

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Shapes to 2.4.0 from 2.3.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Shapes#44 from FoamyGuy/size_properties
  > update rtd py version
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