mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Avoid stray segments and incomplete paths
This commit is contained in:
parent
fef7ba076c
commit
96ced2bdcf
1 changed files with 7 additions and 2 deletions
|
@ -247,8 +247,13 @@ function computeBoolean( path1, path2, operator, _splitCache ){
|
|||
// view.draw()
|
||||
node = node.next;
|
||||
}
|
||||
nuPath.closed = true;
|
||||
boolResult.addChild( nuPath, true );
|
||||
if( nuPath.segments.length > 1 ) {
|
||||
// avoid stray segments and incomplete paths
|
||||
if( nuPath.segments.length > 2 || !nuPath.curves[0].isLinear() ){
|
||||
nuPath.closed = true;
|
||||
boolResult.addChild( nuPath, true );
|
||||
}
|
||||
}
|
||||
}
|
||||
// if( operator.name === 'intersection' ){
|
||||
// window.p = boolResult.reduce();
|
||||
|
|
Loading…
Reference in a new issue