From 8671836b76e8723a1d9021f8d7bf56ce5fdcc6f3 Mon Sep 17 00:00:00 2001 From: Mateusz Adamczyk Date: Sat, 8 Oct 2016 12:33:10 +0200 Subject: Added simple check to viewport, if matrix32 is invesile (https://github.com/godotengine/godot/issues/6296). --- scene/main/viewport.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scene/main') diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index b22d1fcdf4..0c243bd473 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1715,6 +1715,9 @@ Control* Viewport::_gui_find_control_at_pos(CanvasItem* p_node,const Point2& p_g } Matrix32 matrix = p_xform * p_node->get_transform(); + // matrix.basis_determinant() == 0.0f implies that node does not exist on scene + if(matrix.basis_determinant() == 0.0f) + return NULL; if (!c || !c->clips_input() || c->has_point(matrix.affine_inverse().xform(p_global))) { -- cgit v1.2.3