diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-12-16 15:03:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-16 15:03:58 +0100 |
commit | 817165b96cd04adb29e4eef797f9dcc6dd9d022f (patch) | |
tree | 7727b627131b2ad19a63960fa08307878d3daa1d /scene | |
parent | f8ea390b52c48ab34bc3927f6f3fd2ac590b88cf (diff) | |
parent | e4a0abdd93977542d2ace2975670f188c7e5c161 (diff) |
Merge pull request #34246 from tygree/nan-in-sprite-fix
Fixed a bug within sprite.cpp that caused a nan value to appear
Diffstat (limited to 'scene')
-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); |