Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Suspicion of wrong dirty rectangle tracking for transposed tilegrids #4450

@jepler

Description

@jepler

I haven't distilled this down into a test program, but I had a tilegrid with 8x5-pixel tiles, sized 4x23, and transposed. (so it ends up being a wide and short tilegrid)

I found that after the initial draw, only a narrow strip at the left of the tilegrid would be updated when I changed the tiles.

Here are the relevant snippets. Running with recent main branch on a feather rp2040.

font = displayio.Bitmap(8, 5*256, 2) 
with open("/font5x8.bin", "rb") as f:
    f.read(2)
    bitmaptools.readinto(font, f, bits_per_pixel=1)
    
palette = displayio.Palette(2)
palette[1] = 0xff0000
label = displayio.TileGrid(font, pixel_shader=palette, height=23, width=4, tile_width=8, tile_height=5)
label.transpose_xy = True
label.x = 5
group = displayio.Group()
group.append(label)
DISPLAY.show(group)

...
# populate rows with strings to show
    DISPLAY.auto_refresh=False 
    for i, r in enumerate(rows):
        for j, c in enumerate(r):
            #print((i,j, c))
            label[i,j] = ord(c)
        for j in range(j+1, 23):
            label[j,i] = 32
    DISPLAY.auto_refresh=True

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions