File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ class SocketHint {
6767 }
6868
6969 move ( mouse : Point ) : void {
70- console . log ( 'move' , mouse )
70+ // console.log('move', mouse)
7171 let nearest = socket_pool . nearest_within ( mouse , SocketHint . radis , false )
7272
7373 if ( nearest !== undefined ) {
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ class LinePool {
7979 this . lines . push ( e )
8080 }
8181
82- remote_line ( e : Line ) : void {
82+ remove_line ( e : Line ) : void {
8383 this . lines = this . lines . filter ( ( el ) => el . id !== e . id )
8484 }
8585
Original file line number Diff line number Diff line change 11import { flowgraph } from "../flowgraph/flowgraph"
2+ import { line_pool } from "../flowgraph/pool"
23import { TricolorPreset } from "../preset/color"
34import { appendChild } from "../util/appendChild"
45import { Guid , root } from "../util/guid"
@@ -36,12 +37,19 @@ class Line {
3637 this . el . setAttribute ( 'stroke-width' , '5' )
3738 this . el . setAttribute ( 'fill' , 'none' )
3839 appendChild ( flowgraph . el , this )
40+
41+ this . el . addEventListener ( 'click' , ( ) => {
42+ line_pool . remove_line ( this )
43+ this . destructor ( )
44+ } )
45+
3946 this . display ( )
4047 }
4148
4249 destructor ( ) {
4350 this . start . used = false
4451 this . end . used = false
52+ this . el . parentNode ! . removeChild ( this . el )
4553 }
4654
4755 display ( ) {
You can’t perform that action at this time.
0 commit comments