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
Adding a bunch of int conversions on cell_anchor_point math
In multiple places where `cell["cell_anchor_point"] * X` is used, the int conversion is missing, causing `TypeError: can't convert float to int` when an anchor_point is set to `(0.5, 0.5)` for example.
```
Traceback (most recent call last):
File "code.py", line 9, in <module>
File "code_pyportal.py", line 285, in switch_page
File "/lib/adafruit_displayio_layout/layouts/grid_layout.py", line 413, in add_content
File "/lib/adafruit_displayio_layout/layouts/grid_layout.py", line 182, in _layout_cells
File "/lib/adafruit_displayio_layout/widgets/widget.py", line 297, in anchored_position
File "/lib/adafruit_displayio_layout/widgets/widget.py", line 234, in _update_position
TypeError: can't convert float to int
```
I didn't look into the math but I wonder, should it use `round()` rather that `int()` ? (which always rounds down)
0 commit comments