Skip to content
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

Tilegrid size properties #5749

Merged
merged 5 commits into from
Dec 20, 2021
Merged

Tilegrid size properties #5749

merged 5 commits into from
Dec 20, 2021

Conversation

FoamyGuy
Copy link
Collaborator

This change introduces properties to access height, width, as well as tile_height, and tile_width for TileGrid objects. Can be accessed like this:

print("width: {}".format(tile_grid.width))
print("height: {}".format(tile_grid.height))
print("tile_height: {}".format(tile_grid.tile_height))
print("tile_width: {}".format(tile_grid.tile_width))

These values can make it easier to place a TileGrid in some relative position i.e. center it in the center of the display.

@FoamyGuy
Copy link
Collaborator Author

This passed pre-commit locally:

circuitpython_adafruit on  tilegrid_size_props [$?] via 🐍 v3.8.10 
❯ pre-commit run --all-files
Check Yaml...............................................................Passed
Fix End of Files.........................................................Passed
Trim Trailing Whitespace.................................................Passed
Translations.............................................................Passed
Formatting...............................................................Passed

But it failed the formatting check in CI. I'm not sure what could account for the difference. Trying to look into it to see if my version of uncrustify could be different.

@FoamyGuy
Copy link
Collaborator Author

This also seems to have failed several of the builds in CI. But a local build of one of the same boards suceeded:

circuitpython_adafruit/ports/raspberrypi on  tilegrid_size_props [$?] via 🐍 v3.8.10 
❯ make BOARD=adafruit_itsybitsy_rp2040
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
mkdir -p build-adafruit_itsybitsy_rp2040/genhdr
GEN build-adafruit_itsybitsy_rp2040/genhdr/moduledefs.h
QSTR updated
   text    data     bss     dec     hex filename
    248       0       0     248      f8 build-adafruit_itsybitsy_rp2040/boot2.elf

739144 bytes used, 305336 bytes free in flash firmware space out of 1044480 bytes (1020.0kB).
16404 bytes used, 245740 bytes free in ram for stack and heap out of 262144 bytes (256.0kB).

Converting to uf2, output size: 1474048, start address: 0x10000000
Wrote 1474048 bytes to build-adafruit_itsybitsy_rp2040/firmware.uf2

@jepler
Copy link
Member

jepler commented Dec 20, 2021

The build failures are due to tomlkit==0.8.0 being incompatible with 0.7.2. I'll look into it further. It'll probably need a cascadetoml release to fix.

The pre-commit failures are "correct", your code isn't properly indented. Let's figure out why your local config is not working. First, what's uncrustify --version print?

@FoamyGuy
Copy link
Collaborator Author

@jepler thank you

❯ uncrustify --version
Uncrustify-0.71.0_f

@tannewt tannewt requested a review from jepler December 20, 2021 20:11
Copy link
Member

@jepler jepler left a comment

Choose a reason for hiding this comment

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

This looks good, thanks. Didn't actually test it. The cascadetoml build failures will need to be fixed by other means.

@jepler jepler merged commit 6072016 into adafruit:main Dec 20, 2021
Neradoc added a commit to Neradoc/Adafruit_Learning_System_Guides that referenced this pull request Jun 20, 2022
Don't try to set the height property of Sprite, because [it now inherits it from displayio.TileGrid](adafruit/circuitpython#5749).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants