From ce1138cb02c75896e1926ad2e7b51fa2c0cd2f19 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). (cherry picked from commit 8671836b76e8723a1d9021f8d7bf56ce5fdcc6f3) --- core/math/math_2d.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/math/math_2d.cpp') diff --git a/core/math/math_2d.cpp b/core/math/math_2d.cpp index 2cc11aa73..e616f0591 100644 --- a/core/math/math_2d.cpp +++ b/core/math/math_2d.cpp @@ -424,7 +424,7 @@ Matrix32 Matrix32::inverse() const { void Matrix32::affine_invert() { - float det = elements[0][0]*elements[1][1] - elements[1][0]*elements[0][1]; + float det = basis_determinant(); ERR_FAIL_COND(det==0); float idet = 1.0 / det; -- cgit v1.2.3-70-g09d2