         'default'
 
 class Line 
-  constructor: (startx, starty, @paper) ->
+  constructor: (startx, starty, @paper, @set) ->
     @p1 = @paper.circle(startx, starty, 5).attr({fill: '#ff0000', stroke: 'none'})
     @p2 = @paper.circle(startx+6, starty+6, 5).attr({fill: '#ff0000', stroke: 'none'})
+    @set.push @p1
+    @set.push @p2
     @updatePath()
     _by_id = []
     _by_id[@p1.id] = @p1

    _create_point = (x,y) ->
      snapped = _snap_to_grid(x,y)
      unless scope.findPoint(snapped.x, snapped.y)  
        _register_actions scope.addPoint paper.circle(snapped.x, snapped.y, 5).attr({fill: '#ff0000', stroke: 'none'})

    _start_line = (x,y) ->
      snapped       = _snap_to_grid(x, y)
      _current_line = new Line(snapped.x, snapped.y, paper)
      _current_line.p2.click (e) ->
        xy = _get_x_y e
        _end_line(xy.x, xy.y)

      @path.attr path: @path_string()
    else
      @path = @paper.path(@path_string()).attr({stroke:'#ff0000', 'stroke-width': 1})
      @set.push @path
  movePoint: (p, x, y) ->
    p.attr({cx: x, cy: y}) 
    @updatePath()
