File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -419,6 +419,7 @@ var Vector = require('../geometry/Vector');
419419 var c = context ,
420420 render = engine . render ,
421421 options = render . options ,
422+ showInternalEdges = options . showInternalEdges || ! options . wireframes ,
422423 body ,
423424 part ,
424425 i ,
@@ -470,14 +471,25 @@ var Vector = require('../geometry/Vector');
470471 } else {
471472 c . beginPath ( ) ;
472473 c . moveTo ( part . vertices [ 0 ] . x , part . vertices [ 0 ] . y ) ;
473- for ( var j = 1 ; j < part . vertices . length ; j ++ ) {
474- c . lineTo ( part . vertices [ j ] . x , part . vertices [ j ] . y ) ;
474+
475+ for ( j = 1 ; j < part . vertices . length ; j ++ ) {
476+ if ( ! part . vertices [ j - 1 ] . isInternal || showInternalEdges ) {
477+ c . lineTo ( part . vertices [ j ] . x , part . vertices [ j ] . y ) ;
478+ } else {
479+ c . moveTo ( part . vertices [ j ] . x , part . vertices [ j ] . y ) ;
480+ }
481+
482+ if ( part . vertices [ j ] . isInternal && ! showInternalEdges ) {
483+ c . moveTo ( part . vertices [ ( j + 1 ) % part . vertices . length ] . x , part . vertices [ ( j + 1 ) % part . vertices . length ] . y ) ;
484+ }
475485 }
486+
487+ c . lineTo ( part . vertices [ 0 ] . x , part . vertices [ 0 ] . y ) ;
476488 c . closePath ( ) ;
477489 }
478490
479491 if ( ! options . wireframes ) {
480- c . fillStyle = part . render . fillStyle ;
492+ c . fillStyle = part . render . fillStyle ;
481493 c . lineWidth = part . render . lineWidth ;
482494 c . strokeStyle = part . render . strokeStyle ;
483495 c . fill ( ) ;
You can’t perform that action at this time.
0 commit comments