diff options
Diffstat (limited to 'modules/mono/glue/Managed/Files/Rect2.cs')
-rw-r--r-- | modules/mono/glue/Managed/Files/Rect2.cs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/modules/mono/glue/Managed/Files/Rect2.cs b/modules/mono/glue/Managed/Files/Rect2.cs index cb25c267bc..99542d0c0a 100644 --- a/modules/mono/glue/Managed/Files/Rect2.cs +++ b/modules/mono/glue/Managed/Files/Rect2.cs @@ -8,6 +8,7 @@ using real_t = System.Single; namespace Godot { + [Serializable] [StructLayout(LayoutKind.Sequential)] public struct Rect2 : IEquatable<Rect2> { @@ -156,13 +157,13 @@ namespace Godot public bool Intersects(Rect2 b) { - if (_position.x > b._position.x + b._size.x) + if (_position.x >= b._position.x + b._size.x) return false; - if (_position.x + _size.x < b._position.x) + if (_position.x + _size.x <= b._position.x) return false; - if (_position.y > b._position.y + b._size.y) + if (_position.y >= b._position.y + b._size.y) return false; - if (_position.y + _size.y < b._position.y) + if (_position.y + _size.y <= b._position.y) return false; return true; @@ -182,8 +183,8 @@ namespace Godot return newRect; } - - // Constructors + + // Constructors public Rect2(Vector2 position, Vector2 size) { _position = position; |