mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Use same tolerance in Curve.isLinear() as in Curve#isLinear().
This commit is contained in:
parent
2a3ede67bb
commit
a07538b205
2 changed files with 4 additions and 2 deletions
|
@ -598,7 +598,9 @@ statics: {
|
|||
},
|
||||
|
||||
isLinear: function(v) {
|
||||
return v[0] === v[2] && v[1] === v[3] && v[4] === v[6] && v[5] === v[7];
|
||||
var isZero = Numerical.isZero;
|
||||
return isZero(v[0] - v[2]) && isZero(v[1] - v[3])
|
||||
&& isZero(v[4] - v[6]) && isZero(v[5] - v[7]);
|
||||
},
|
||||
|
||||
isFlatEnough: function(v, tolerance) {
|
||||
|
|
|
@ -70,7 +70,7 @@ var Numerical = new function() {
|
|||
* Numerical.EPSILON.
|
||||
*/
|
||||
isZero: function(val) {
|
||||
return abs(val) <= this.EPSILON;
|
||||
return abs(val) <= Numerical.EPSILON;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue