       points: mark.points
 
     isComplete: (mark) ->
-      mark.closed?
+      mark.closed
 
   render: ->
     averageScale = (@props.scale.horizontal + @props.scale.vertical) / 2


    defaultValues: ({x, y}) ->
      points: []
      closed: null

    initStart: ({x, y}, mark) ->
      mark.points.push {x, y}


    <DrawingToolRoot tool={this}>
      <Draggable onDrag={@handleMainDrag} disabled={@props.disabled}>
        <polyline points={points} fill={'none' unless @props.mark.closed} />
      </Draggable>

      {if @props.selected
        <g>
          <DeleteButton tool={this} x={deleteButtonPosition.x} y={deleteButtonPosition.y} />

          {if not @props.mark.closed and  @props.mark.points.length > 2
            <line className="guideline" x1={lastPoint.x} y1={lastPoint.y} x2={firstPoint.x} y2={firstPoint.y} />}

          {for point, i in @props.mark.points
            <DragHandle key={i} x={point.x} y={point.y} scale={@props.scale} onDrag={@handleHandleDrag.bind this, i} />}

          {unless @props.mark.closed
            <g>
              <circle className="clickable" r={finisherRadius} cx={firstPoint.x} cy={firstPoint.y} stroke="transparent" onClick={@handleFinishClick} />
              <circle className="clickable" r={finisherRadius} cx={lastPoint.x} cy={lastPoint.y} onClick={@handleFinishClick} />
            </g>}
        </g>}
    </DrawingToolRoot>

  handleFinishClick: ->
    @props.mark.closed = true
    @props.onChange()

  handleMainDrag: (e, d) ->
