Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect error value in decomposeMatrix(). #121

Merged
merged 3 commits into from
Apr 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: node_js

node_js:
- "4.4.4"
- "6.10.2"

install:
- BROWSER="Firefox-stable" ./.travis-setup.sh
Expand Down
2 changes: 1 addition & 1 deletion src/matrix-decomposition.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
}

if (determinant(perspectiveMatrix) === 0) {
return false;
return null;
}

var rhs = [];
Expand Down
2 changes: 1 addition & 1 deletion test/js/color-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ suite('color-handler', function() {
test('invalid colors fail to parse', function() {
assert.isUndefined(parseColor(''));
assert.isUndefined(parseColor('bananayellow'));
assert.isUndefined(parseColor('rgb(10, 20, 30, 40)'));
assert.isUndefined(parseColor('rgb(10, 20, 30, 40, 50)'));
});
test('color interpolation', function() {
assert.equal(webAnimations1.propertyInterpolation('color', '#00aa11', '#aa00bb')(0.2), 'rgba(34,136,51,1)');
Expand Down
9 changes: 9 additions & 0 deletions test/js/matrix-interpolation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)',
Expand Down