mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Revert "No need for special length handling in propagateWinding()"
This reverts commit 8c702ce5b4
.
This commit is contained in:
parent
f8595e93c6
commit
7c37a4a4d2
1 changed files with 6 additions and 1 deletions
|
@ -367,7 +367,8 @@ PathItem.inject(new function() {
|
|||
// contribution for the curve-chain starting with this segment. Once we
|
||||
// have enough confidence in the winding contribution, we can propagate
|
||||
// it until the next intersection or end of a curve chain.
|
||||
var chain = [],
|
||||
var epsilon = /*#=*/Numerical.GEOMETRIC_EPSILON,
|
||||
chain = [],
|
||||
start = segment,
|
||||
totalLength = 0,
|
||||
windingSum = 0;
|
||||
|
@ -390,6 +391,10 @@ PathItem.inject(new function() {
|
|||
var node = chain[k],
|
||||
curveLength = node.length;
|
||||
if (length <= curveLength) {
|
||||
// If the selected location on the curve falls onto its
|
||||
// beginning or end, use the curve's center instead.
|
||||
if (length < epsilon || curveLength - length < epsilon)
|
||||
length = curveLength / 2;
|
||||
var curve = node.curve,
|
||||
path = curve._path,
|
||||
parent = path._parent,
|
||||
|
|
Loading…
Reference in a new issue