( )
| 373 | } |
| 374 | |
| 375 | insertNode( ){ |
| 376 | //Called by context menu |
| 377 | const pt = this.menu.position; |
| 378 | const prevPt = {}; |
| 379 | let found = false; |
| 380 | |
| 381 | this.nodes.forEach( node => { |
| 382 | if ( !found ){ |
| 383 | const pt1 = this.graph.convertPathToScreen( node.x, node.y ); |
| 384 | |
| 385 | if ( node.tool == 'lineTo' && prevPt.x != undefined ){ |
| 386 | if ( Geometry.calcIsInsideThickLineSegment( prevPt, pt1, pt, 10 ) ){ |
| 387 | const index = this.nodes.indexOf( node ); |
| 388 | this.addNode( this.config.tool, pt.x, pt.y, index ); |
| 389 | found = true; |
| 390 | } |
| 391 | } |
| 392 | |
| 393 | prevPt.x = pt1.x; |
| 394 | prevPt.y = pt1.y; |
| 395 | } |
| 396 | }) |
| 397 | } |
| 398 | |
| 399 | changeNode(){ |
| 400 | //Called by context menu |
nothing calls this directly
no test coverage detected