mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Add an optional ignoreLinear parameter to Curve#divide, so that new segments on linear curves will keep their correct bezier handles.
This commit is contained in:
parent
20b6d699db
commit
3b013c0720
1 changed files with 2 additions and 2 deletions
|
@ -348,13 +348,13 @@ var Curve = Base.extend(/** @lends Curve# */{
|
|||
* @return {Curve} the second part of the divided curve
|
||||
*/
|
||||
// TODO: Rename to divideAt()?
|
||||
divide: function(offset, isParameter) {
|
||||
divide: function(offset, isParameter, ignoreLinear) {
|
||||
var parameter = this._getParameter(offset, isParameter),
|
||||
tolerance = /*#=*/ Numerical.TOLERANCE,
|
||||
res = null;
|
||||
if (parameter > tolerance && parameter < 1 - tolerance) {
|
||||
var parts = Curve.subdivide(this.getValues(), parameter),
|
||||
isLinear = this.isLinear(),
|
||||
isLinear = ignoreLinear ? false : this.isLinear(),
|
||||
left = parts[0],
|
||||
right = parts[1];
|
||||
|
||||
|
|
Loading…
Reference in a new issue