mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-21 18:42:00 -04:00
Introduce Numerical.isZero(), for comparisons against 0 with a tolerance.
This commit is contained in:
parent
125fa1c051
commit
400b454177
7 changed files with 16 additions and 11 deletions
src/basic
|
@ -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;
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue