Rename ignoreStraight argument to _setHandles

This commit is contained in:
Jürg Lehni 2015-10-01 05:55:22 -05:00
parent 0ca5a106de
commit 53dd726057
2 changed files with 5 additions and 4 deletions

View file

@ -463,7 +463,7 @@ var Curve = Base.extend(/** @lends Curve# */{
* is within the valid range, {code null} otherwise.
*/
// TODO: Rename to divideAt()?
divide: function(offset, isParameter, ignoreStraight) {
divide: function(offset, isParameter, _setHandles) {
var parameter = this._getParameter(offset, isParameter),
tMin = /*#=*/Numerical.CURVETIME_EPSILON,
tMax = 1 - tMin,
@ -471,7 +471,7 @@ var Curve = Base.extend(/** @lends Curve# */{
// Only divide if not at the beginning or end.
if (parameter >= tMin && parameter <= tMax) {
var parts = Curve.subdivide(this.getValues(), parameter),
setHandles = ignoreStraight || this.hasHandles(),
setHandles = _setHandles || this.hasHandles(),
left = parts[0],
right = parts[1];

View file

@ -200,8 +200,9 @@ PathItem.inject(new function() {
} else if (t > tMax) {
segment = curve._segment2;
} else {
// Split the curve at t, passing true for ignoreStraight to not
// force the result of splitting straight curves straight.
// Split the curve at t, passing true for _setHandles to always
// set the handles on the sub-curves even if the original curve
// had no handles.
var newCurve = curve.divide(t, true, true);
segment = newCurve._segment1;
curve = newCurve.getPrevious();