summaryrefslogtreecommitdiffstats
path: root/scene/2d/sprite_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/sprite_2d.cpp')
-rw-r--r--scene/2d/sprite_2d.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/scene/2d/sprite_2d.cpp b/scene/2d/sprite_2d.cpp
index 3c19dd0020..5745a59297 100644
--- a/scene/2d/sprite_2d.cpp
+++ b/scene/2d/sprite_2d.cpp
@@ -374,8 +374,7 @@ bool Sprite2D::is_pixel_opaque(const Point2 &p_point) const {
q.y = texture->get_size().height - q.y - 1;
}
} else {
- q.x = MIN(q.x, texture->get_size().width - 1);
- q.y = MIN(q.y, texture->get_size().height - 1);
+ q = q.min(texture->get_size() - Vector2(1, 1));
}
return texture->is_pixel_opaque((int)q.x, (int)q.y);