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

Potentially allow TileGrid Bitmaps to be changed to different sized images #6323

Open
FoamyGuy opened this issue Apr 28, 2022 · 0 comments
Open

Comments

@FoamyGuy
Copy link
Collaborator

@FoamyGuy FoamyGuy commented Apr 28, 2022

#6270 added the ability to update tilegrid.bitmap to a new bitmap different from the one the TileGrid was initialized with. Currently this functionality is limited to such that the new bitmap must be the exact same size as the previous bitmap. Enforced by a check in the core setter that raises an exception.

During the development of that functionality I did try bitmaps of different sizes, it didn't cause a crash or other major problem, but also did not display the new bitmap properly. It showed a section of the new bitmap the size of the old bitmap. For instance using tile_size matching the image size if the initial bitmap was 16x16 pixels and the new bitmap is 4x that at 64x64 pixels when setting the new one what you'd see on the display is the top left quarter of the new bitmap rather than the full thing. I did try changing the tile_width and tile_height at the same time that the bitmap was changed but still got the same results. I suspect there is something that needs to be done in order to make it recognize the new size and re-draw as needed to match the newly sized image.

I didn't dig any further at the time because using same sized new bitmaps covers all of the use cases I have in mind currently for this functionality, so supporting different sizes would have been a nice bonus, but not something I have a specific use for atm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant