From e4a0abdd93977542d2ace2975670f188c7e5c161 Mon Sep 17 00:00:00 2001 From: Tyler Greenwood Date: Tue, 10 Dec 2019 11:23:30 -0500 Subject: Fixed a bug within sprite.cpp that caused nan values to appear when a texture had zero area --- scene/2d/sprite.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp index 8cdfceea52..a595f6714b 100644 --- a/scene/2d/sprite.cpp +++ b/scene/2d/sprite.cpp @@ -315,6 +315,9 @@ bool Sprite::is_pixel_opaque(const Point2 &p_point) const { if (texture.is_null()) return false; + if (texture->get_size().width == 0 || texture->get_size().height == 0) + return false; + Rect2 src_rect, dst_rect; bool filter_clip; _get_rects(src_rect, dst_rect, filter_clip); -- cgit v1.2.3