We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef99e59 commit 0b818d7Copy full SHA for 0b818d7
crates/bevy_sprite/src/collide_aabb.rs
@@ -42,7 +42,7 @@ pub fn collide(a_pos: Vec3, a_size: Vec2, b_pos: Vec3, b_size: Vec2) -> Option<C
42
// if we had an "x" and a "y" collision, pick the "primary" side using penetration depth
43
match (x_collision, y_collision) {
44
(Some(x_collision), Some(y_collision)) => {
45
- if y_depth < x_depth {
+ if y_depth.abs() < x_depth.abs() {
46
Some(y_collision)
47
} else {
48
Some(x_collision)
0 commit comments