From 0d17d49bca6968853491c7658da4caa467ed6382 Mon Sep 17 00:00:00 2001 From: Alan Cutter Date: Wed, 12 Apr 2017 17:58:51 +1000 Subject: [PATCH] matrixCrash --- src/matrix-decomposition.js | 2 +- test/js/matrix-interpolation.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/matrix-decomposition.js b/src/matrix-decomposition.js index 57e787be..948104c3 100644 --- a/src/matrix-decomposition.js +++ b/src/matrix-decomposition.js @@ -121,7 +121,7 @@ } if (determinant(perspectiveMatrix) === 0) { - return false; + return null; } var rhs = []; diff --git a/test/js/matrix-interpolation.js b/test/js/matrix-interpolation.js index 383a1516..580678d5 100644 --- a/test/js/matrix-interpolation.js +++ b/test/js/matrix-interpolation.js @@ -39,6 +39,15 @@ suite('matrix interpolation', function() { var evaluatedInterp = interpolatedMatrix(0.5); compareMatrices(evaluatedInterp, [1, -0.1, 0, 1, 0, 0], 6); + var interpolatedMatrix = webAnimations1.propertyInterpolation( + 'transform', + 'matrix(0, 0, 0, 0, 0, 0)', + 'matrix(1, 0, 0, 1, 0, 0)'); + var evaluatedInterp = interpolatedMatrix(0.25); + compareMatrices(evaluatedInterp, [0, 0, 0, 0, 0, 0], 6); + evaluatedInterp = interpolatedMatrix(0.75); + compareMatrices(evaluatedInterp, [1, 0, 0, 1, 0, 0], 6); + interpolatedMatrix = webAnimations1.propertyInterpolation( 'transform', 'matrix(1, 0, 0, 1, 0, 0)',