diff options
author | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-03-03 12:49:08 +0100 |
---|---|---|
committer | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-03-20 13:47:42 +0100 |
commit | 79ba22a73f238ebd110fc5f3744c3c12a9a59475 (patch) | |
tree | ff5d57ddb759c04297aa6482cdc389ca8bc0c2cf /scene/gui/texture_button.cpp | |
parent | fe01776f05b1787b28b4a270d53037a3c25f4ca2 (diff) | |
download | redot-engine-79ba22a73f238ebd110fc5f3744c3c12a9a59475.tar.gz |
Use `Vector*` component-wise `min/max/clamp` functions where applicable
Diffstat (limited to 'scene/gui/texture_button.cpp')
-rw-r--r-- | scene/gui/texture_button.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/texture_button.cpp b/scene/gui/texture_button.cpp index dcbb25c41d..0b197c8c02 100644 --- a/scene/gui/texture_button.cpp +++ b/scene/gui/texture_button.cpp @@ -103,8 +103,8 @@ bool TextureButton::has_point(const Point2 &p_point) const { point *= scale; // finally, we need to check if the point is inside a rectangle with a position >= 0,0 and a size <= mask_size - rect.position = Point2(MAX(0, _texture_region.position.x), MAX(0, _texture_region.position.y)); - rect.size = Size2(MIN(mask_size.x, _texture_region.size.x), MIN(mask_size.y, _texture_region.size.y)); + rect.position = Point2().max(_texture_region.position); + rect.size = mask_size.min(_texture_region.size); } if (!rect.has_point(point)) { |