diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-24 01:14:51 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-24 01:14:51 +0100 |
commit | cd4e4c0fccfdbfe04d91617a1bc6c4785dd6a1ec (patch) | |
tree | d675bc1f5eaaf3a69a6eb9c2bb7ec254e90f3b10 /scene/gui/texture_button.cpp | |
parent | 33cca7c65c5c3b02ffdbecfd916e27fa6bc41eb5 (diff) | |
parent | 79ba22a73f238ebd110fc5f3744c3c12a9a59475 (diff) | |
download | redot-engine-cd4e4c0fccfdbfe04d91617a1bc6c4785dd6a1ec.tar.gz |
Merge pull request #89111 from AThousandShips/vec_use
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)) { |