mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-03-13 16:33:28 -04:00
Streamline handling of undefined properties in CurveLocation.
This commit is contained in:
parent
30e92c8a35
commit
0c0807e3e9
1 changed files with 4 additions and 3 deletions
|
@ -120,8 +120,9 @@ CurveLocation = Base.extend(/** @lends CurveLocation# */{
|
|||
* @bean
|
||||
*/
|
||||
getCurveOffset: function() {
|
||||
var parameter = this._curve && this.getParameter();
|
||||
return parameter != null ? this._curve.getLength(0, parameter) : null;
|
||||
var parameter = this.getParameter();
|
||||
return parameter != null && this._curve
|
||||
&& this._curve.getLength(0, parameter);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -133,7 +134,7 @@ CurveLocation = Base.extend(/** @lends CurveLocation# */{
|
|||
* @bean
|
||||
*/
|
||||
getParameter: function() {
|
||||
if (this._parameter == null && this._point)
|
||||
if (this._parameter == null && this._curve && this._point)
|
||||
this._parameter = this._curve.getParameter(this._point);
|
||||
return this._parameter;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue