Introduce Numerical.isZero(), for comparisons against 0 with a tolerance.

This commit is contained in:
Jürg Lehni 2012-11-05 21:06:13 -08:00
parent 125fa1c051
commit 400b454177
7 changed files with 16 additions and 11 deletions
src/basic

View file

@ -446,7 +446,7 @@ var Matrix = this.Matrix = Base.extend(/** @lends Matrix# */{
*/
_getDeterminant: function() {
var det = this._a * this._d - this._b * this._c;
return isFinite(det) && Math.abs(det) > Numerical.EPSILON
return isFinite(det) && !Numerical.isZero(det)
&& isFinite(this._tx) && isFinite(this._ty)
? det : null;
},