mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Fix issue where removing segments from open paths would correct curves wrongly.
This commit is contained in:
parent
5da4e89672
commit
d509f86e1a
1 changed files with 5 additions and 3 deletions
|
@ -590,9 +590,11 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
|||
segments[i]._index = i;
|
||||
// Keep curves in sync
|
||||
if (curves) {
|
||||
// If we're removing the last segment of a closing path, remove the
|
||||
// last curve.
|
||||
curves.splice(from == curves.length ? from - 1 : from, amount);
|
||||
// If we're removing the last segment, remove the last curve. Also
|
||||
// take into account closed paths, which have one curve more than
|
||||
// segments.
|
||||
curves.splice(from == segments.length + (this._closed ? 1 : 0)
|
||||
? from - 1 : from, amount);
|
||||
// Adjust segments for the curves before and after the removed ones
|
||||
var curve;
|
||||
if (curve = curves[from - 1])
|
||||
|
|
Loading…
Reference in a new issue