mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
parent
b874a642ab
commit
ef4eee1064
3 changed files with 5 additions and 3 deletions
|
@ -342,6 +342,7 @@ var Curve = Base.extend(/** @lends Curve# */{
|
||||||
* is a curve time parameter.
|
* is a curve time parameter.
|
||||||
* @return {Curve} the second part of the divided curve
|
* @return {Curve} the second part of the divided curve
|
||||||
*/
|
*/
|
||||||
|
// TODO: Rename to divideAt()?
|
||||||
divide: function(offset, isParameter) {
|
divide: function(offset, isParameter) {
|
||||||
var parameter = this._getParameter(offset, isParameter),
|
var parameter = this._getParameter(offset, isParameter),
|
||||||
res = null;
|
res = null;
|
||||||
|
@ -407,6 +408,7 @@ var Curve = Base.extend(/** @lends Curve# */{
|
||||||
* @return {Path} The newly created path after splitting, if any
|
* @return {Path} The newly created path after splitting, if any
|
||||||
* @see Path#split(index, parameter)
|
* @see Path#split(index, parameter)
|
||||||
*/
|
*/
|
||||||
|
// TODO: Rename to splitAt()?
|
||||||
split: function(offset, isParameter) {
|
split: function(offset, isParameter) {
|
||||||
return this._path
|
return this._path
|
||||||
? this._path.split(this._segment1._index,
|
? this._path.split(this._segment1._index,
|
||||||
|
|
|
@ -238,12 +238,12 @@ var CurveLocation = Base.extend(/** @lends CurveLocation# */{
|
||||||
|
|
||||||
divide: function() {
|
divide: function() {
|
||||||
var curve = this.getCurve(true);
|
var curve = this.getCurve(true);
|
||||||
return curve && curve.divide(this.getParameter(true));
|
return curve && curve.divide(this.getParameter(true), true);
|
||||||
},
|
},
|
||||||
|
|
||||||
split: function() {
|
split: function() {
|
||||||
var curve = this.getCurve(true);
|
var curve = this.getCurve(true);
|
||||||
return curve && curve.split(this.getParameter(true));
|
return curve && curve.split(this.getParameter(true), true);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1037,7 +1037,7 @@ var Path = PathItem.extend(/** @lends Path# */{
|
||||||
if (parameter > 0) {
|
if (parameter > 0) {
|
||||||
// Divide the curve with the index at given parameter.
|
// Divide the curve with the index at given parameter.
|
||||||
// Increase because dividing adds more segments to the path.
|
// Increase because dividing adds more segments to the path.
|
||||||
curves[index++].divide(parameter);
|
curves[index++].divide(parameter, true);
|
||||||
}
|
}
|
||||||
// Create the new path with the segments to the right of given
|
// Create the new path with the segments to the right of given
|
||||||
// parameter, which are removed from the current path. Pass true
|
// parameter, which are removed from the current path. Pass true
|
||||||
|
|
Loading…
Reference in a new issue