mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Calculate CurveLocation#parameter uncached when dealing with dividing or splitting, since these commands alter the underlying Path.
This commit is contained in:
parent
5a2be6d545
commit
8cea919dbd
1 changed files with 8 additions and 4 deletions
|
@ -138,10 +138,10 @@ CurveLocation = Base.extend(/** @lends CurveLocation# */{
|
|||
* @type Number
|
||||
* @bean
|
||||
*/
|
||||
getParameter: function() {
|
||||
if (this._parameter == null && this._curve && this._point) {
|
||||
getParameter: function(/* uncached */) {
|
||||
if ((this._parameter == null || arguments[0])
|
||||
&& this._curve && this._point)
|
||||
this._parameter = this._curve.getParameterOf(this._point);
|
||||
}
|
||||
return this._parameter;
|
||||
},
|
||||
|
||||
|
@ -193,7 +193,11 @@ CurveLocation = Base.extend(/** @lends CurveLocation# */{
|
|||
},
|
||||
|
||||
divide: function() {
|
||||
return this._curve ? this._curve.divide(this.getParameter()) : null;
|
||||
return this._curve ? this._curve.divide(this.getParameter(true)) : null;
|
||||
},
|
||||
|
||||
split: function() {
|
||||
return this._curve ? this._curve.split(this.getParameter(true)) : null;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue