diff options
author | Marcel Admiraal <madmiraal@users.noreply.github.com> | 2020-12-19 12:43:35 +0000 |
---|---|---|
committer | Marcel Admiraal <madmiraal@users.noreply.github.com> | 2020-12-19 12:59:08 +0000 |
commit | 2df9a8ccadf3e7f99d767456eedb0e559c96572c (patch) | |
tree | 9003944ed17b8c4d28d2991a4e97f8845c25e685 /core/math/rect2.h | |
parent | 16524d4ae1d2dc8643b97349dbbba603de77fc2b (diff) |
Rename Rect2 and Rect2i clip() to intersection()
Diffstat (limited to 'core/math/rect2.h')
-rw-r--r-- | core/math/rect2.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/math/rect2.h b/core/math/rect2.h index b1fe865ba5..f36084ec74 100644 --- a/core/math/rect2.h +++ b/core/math/rect2.h @@ -123,8 +123,9 @@ struct Rect2 { _FORCE_INLINE_ bool has_no_area() const { return (size.x <= 0 || size.y <= 0); } - inline Rect2 clip(const Rect2 &p_rect) const { /// return a clipped rect + // Returns the instersection between two Rect2s or an empty Rect2 if there is no intersection + inline Rect2 intersection(const Rect2 &p_rect) const { Rect2 new_rect = p_rect; if (!intersects(new_rect)) { @@ -365,8 +366,9 @@ struct Rect2i { _FORCE_INLINE_ bool has_no_area() const { return (size.x <= 0 || size.y <= 0); } - inline Rect2i clip(const Rect2i &p_rect) const { /// return a clipped rect + // Returns the instersection between two Rect2is or an empty Rect2i if there is no intersection + inline Rect2i intersection(const Rect2i &p_rect) const { Rect2i new_rect = p_rect; if (!intersects(new_rect)) { |