Skip to content

displayio.Shape does not change after calling set_boundary() again #3201

@FoamyGuy

Description

@FoamyGuy

I have this script:

import displayio
import board
import time

WIDTH = 100
HEIGHT = 100
display = board.DISPLAY

shape = displayio.Shape(WIDTH, HEIGHT, mirror_x=False, mirror_y=False)
for y in range(HEIGHT):
    shape.set_boundary(y, 0, 30)

palette = displayio.Palette(2)
palette[0] = 0x0000FF
palette[1] = 0x00FFFF

tile_grid = displayio.TileGrid(shape, pixel_shader=palette)
group = displayio.Group()
group.append(tile_grid)
display.show(group)

#time.sleep(1)
while True:
    for y in range(HEIGHT):
        shape.set_boundary(y, 0, 80)
    time.sleep(1)
    for y in range(HEIGHT):
        shape.set_boundary(y, 0, 30)
    time.sleep(1)

If I run this code as-is I will see the 80px wide shape drawn on the screen but it will never change to 30px wide even though are changing the shape with new calls to set_boundary() inside the main loop.

If I un-comment the time.sleep(1) on the line before the main loop then I will see the 30px wide shape drawn on the screen, but never the 80px one.

The shape seems to get "stuck" at a certain size and does not change visually with further changes. Calling time.sleep() seems to have some impact on which size the shape is shown at, but it's "stuck" either way, never changing visibly.

I tested this on PyPortal and PyGamer both versions 5.3.1 and 6.0.0.alpha2.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions