         '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


    $scope.reset = ->
      $scope.resetting = true
      _.each $scope.points, (p) -> $scope.removePoint(p.id).remove()
      $scope.resetting = false
      $timeout -> _update()

    $scope.$watch 'settings', () ->
      $scope.reset()

      width:  padding*2+width+'px'
      height: padding*2+height+'px'

    paper              = new Raphael(element.find('.canvas')[0], (padding*2)+width, (padding*2)+height)
    glass              = paper.rect(padding,padding,height,width).attr('stroke': 'none').attr('fill', 'white')
    scope.image_set    = paper.set()
    scope.points_lines = paper.set()

    _draw_background()

