Rust-SDL2 / rust-sdl2

SDL2 bindings for Rust
MIT License
2.65k stars 465 forks source link

Fix rect shifted logic #1398

Closed Player01osu closed 2 weeks ago

Player01osu commented 1 month ago

Currently, the rect shifted methods offsets itself by the shifted amount on one axis, and by the rect point on the other. The expected behavior is that the rect is shifted on one axis, while the other one stays the same.

This change sets the offset of the other axis to 0, as well as changing the tests to better cover these edge cases.