diff options
author | Tyler Greenwood <tygree@umich.edu> | 2019-12-10 11:23:30 -0500 |
---|---|---|
committer | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-12-16 13:53:35 +0100 |
commit | e4a0abdd93977542d2ace2975670f188c7e5c161 (patch) | |
tree | c1640b6aab13f650bb77fd59cc2f05d0b8781bad | |
parent | d4601776db56df158753463b1e669c859b16bc42 (diff) |
Fixed a bug within sprite.cpp that caused nan values to appear when a texture had zero area
-rw-r--r-- | scene/2d/sprite.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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); |