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
Changing Sprite.width/height does not update hitbox #752
Comments
Ok, I inspected the code and found that error comes from the self._points attribute NOT being set to None in _set_width setter in Sprite class. Of course the same problem exists for _set_height setter too. I've also found other, strange thing.In _set_width setter there is a call to spritelist.update_size() but in _set_height there is call to spritelist.update_height(). I wonder why is that so? Should not ther be a call to spritelist.update_width() ? @pvcraven ? |
Updating sprite width/height was not changing it's hitbox. Now it is.
I think this was fixed with that Oct 3 check-in. |
Bug Report
Changing Sprite.width/height does not update hitbox.
This results in wrong behaviour using:
Sprite.left/right/top/bottom
Sprite.collides_with_point
Actual behavior:
Running example code fails with
AssertionError
Expected behavior:
Changing properties of sprite like
Sprite.width/height
should update the hitbox.Example code draws Sprite, passing the asserts
Steps to reproduce/example code:
The text was updated successfully, but these errors were encountered: