-
Notifications
You must be signed in to change notification settings - Fork 15
widget.py - TypeError: can't convert float to int #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Interesting. I'm not sure why it was able to run successfully in the past.
No matter how it got the float into Adafruit_CircuitPython_DisplayIO_Layout/adafruit_displayio_layout/widgets/widget.py Lines 231 to 240 in 48b512a
I can look into this more and make a PR for it tonight. There is a similar (but not exact same) issue resolved by one of the current PRs so I'll check that out tonight as well. |
I did a quick test of simply adding a final int cast in the assignment: self.x = int( and same for But if this indicating an issue somewhere else, then might not be best fix. |
Off the top of my head I think it indicates a possible bug in the Touch Deck code. But if that does exist I'm not sure why it would have ever run in the past, so possibly there is nothing needing fixing in there after all. I do think adding the int cast like you did is a good solution. Even if there is a bug elsewhere causing float values to get set to the
And I think we should not crash in that case ideally, which the |
Re this thread:
https://forums.adafruit.com/viewtopic.php?f=47&t=186239
Added a dump of the values just before this line:
Adafruit_CircuitPython_DisplayIO_Layout/adafruit_displayio_layout/widgets/widget.py
Line 230 in 48b512a
thusly:
and get:
So some of the values are float making the result also float.
displayio.Group.x
requiresint
.The text was updated successfully, but these errors were encountered: