You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importdisplayioimportvectorioline_palette=displayio.Palette(1)
line_palette[0] =0xFFFFFFline_one=vectorio.Rectangle(width=64, height=1, x=0, y=0, pixel_shader=line_palette)
# Test Three - Doesn't error when location is outside of signed int 16 valuesline_one=vectorio.Rectangle(width=64, height=1, x=50000, y=50000, pixel_shader=line_palette)
print("Test One: Location set to (50000, 50000) but stored as", line_one.location, "It should have errored")
foriinrange(0,100000,10000):
# Test Two - Doesn't error when location is outside of signed int 16 valuesline_one.x=iline_one.y=iprint("Test Two", i, line_one.location)
foriinrange(0,100000,10000):
print("Test Three", i)
# Test Three - Correctly errors when location is outside of signed int 16 valuesline_one.location= (i, i)
print(" T3", line_one.location)
When you set the location of a vectorio shape via the constructor, the x or y properties, no bounds checking is performed. If it is set via the location property, bounds checking is performed and raises a ValueError
Additional information
No response
The text was updated successfully, but these errors were encountered:
CircuitPython version
Code/REPL
Behavior
Description
When you set the location of a
vectorio
shape via the constructor, thex
ory
properties, no bounds checking is performed. If it is set via thelocation
property, bounds checking is performed and raises aValueError
Additional information
No response
The text was updated successfully, but these errors were encountered: