Skip to content

Commit b3b548e

Browse files
bors[bot]Shou
andauthored
Merge #948
948: fix(rect2): match Rect2.intersects with Godot logic r=Bromeon a=Shou Fixes #947 Co-authored-by: Shou <[email protected]>
2 parents bd2abef + 5a5a62d commit b3b548e

File tree

1 file changed

+2
-2
lines changed
  • gdnative-core/src/core_types/geom

1 file changed

+2
-2
lines changed

gdnative-core/src/core_types/geom/rect2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ impl Rect2 {
115115
self.position.x < b.position.x + b.size.x
116116
&& self.position.x + self.size.x > b.position.x
117117
&& self.position.y < b.position.y + b.size.y
118-
&& self.position.y + self.size.y > b.size.y
118+
&& self.position.y + self.size.y > b.position.y
119119
}
120120

121121
/// Returns true if the rectangle overlaps with `b` (i.e. they have at least one point in
@@ -130,7 +130,7 @@ impl Rect2 {
130130
self.position.x <= b.position.x + b.size.x
131131
&& self.position.x + self.size.x >= b.position.x
132132
&& self.position.y <= b.position.y + b.size.y
133-
&& self.position.y + self.size.y >= b.size.y
133+
&& self.position.y + self.size.y >= b.position.y
134134
}
135135

136136
/// Returns true if this rectangle (inclusively) encloses `b`.

0 commit comments

Comments
 (0)