Forráskód Böngészése

Fixed a bug within sprite.cpp that caused nan values to appear when a texture had zero area

Tyler Greenwood 5 éve
szülő
commit
e4a0abdd93
1 módosított fájl, 3 hozzáadás és 0 törlés
  1. 3 0
      scene/2d/sprite.cpp

+ 3 - 0
scene/2d/sprite.cpp

@@ -315,6 +315,9 @@ bool Sprite::is_pixel_opaque(const Point2 &p_point) const {
 	if (texture.is_null())
 	if (texture.is_null())
 		return false;
 		return false;
 
 
+	if (texture->get_size().width == 0 || texture->get_size().height == 0)
+		return false;
+
 	Rect2 src_rect, dst_rect;
 	Rect2 src_rect, dst_rect;
 	bool filter_clip;
 	bool filter_clip;
 	_get_rects(src_rect, dst_rect, filter_clip);
 	_get_rects(src_rect, dst_rect, filter_clip);