mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Some code cleanup for #1515
This commit is contained in:
parent
9f4bc8d7a3
commit
8792d142b3
1 changed files with 7 additions and 10 deletions
|
@ -750,27 +750,24 @@ PathItem.inject(new function() {
|
|||
// first operand.
|
||||
var wind = null;
|
||||
if (operator.subtract && path2) {
|
||||
// calculate path winding at point depending on operand
|
||||
// Calculate path winding at point depending on operand.
|
||||
var pathWinding = operand === path1
|
||||
? path2._getWinding(pt, dir, true)
|
||||
: path1._getWinding(pt, dir, true);
|
||||
// if curve should be omitted
|
||||
// Check if curve should be omitted.
|
||||
if (operand === path1 && pathWinding.winding ||
|
||||
operand === path2 && !pathWinding.winding) {
|
||||
// if quality is not good enough
|
||||
// Check if quality is not good enough...
|
||||
if (pathWinding.quality < 1) {
|
||||
// skip this point
|
||||
// ...and if so, skip this point...
|
||||
continue;
|
||||
} else {
|
||||
// omit curve
|
||||
wind = {winding: 0, quality: 1};
|
||||
// ...otherwise, omit this curve.
|
||||
wind = { winding: 0, quality: 1 };
|
||||
}
|
||||
}
|
||||
}
|
||||
// default case
|
||||
if (wind === null) {
|
||||
wind = getWinding(pt, curves, dir, true);
|
||||
}
|
||||
wind = wind || getWinding(pt, curves, dir, true);
|
||||
if (wind.quality > winding.quality)
|
||||
winding = wind;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue