Description
#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.