 
     # End stroke.
     @lastStrokeCoordinates null
+
+    @drawStraight false
 
   applyPencil: ->
     return unless @mouseState.leftButton

    layerOrigin =
      x: layer?.origin?.x or 0
      y: layer?.origin?.y or 0

    for absolutePixel in @pixels()
      absoluteCoordinates = _.pick absolutePixel, ['x', 'y']
      @lastPixelCoordinates absoluteCoordinates
      @lastStrokeCoordinates absoluteCoordinates
      
      # Create the new pixel in relative coordinates.
      pixel = _.clone absolutePixel
      pixel.x -= layerOrigin.x
      pixel.y -= layerOrigin.y
        

  onMouseMove: (event) ->
    super arguments...

    currentPixelCoordinates = @currentPixelCoordinates()

    newPixelCoordinates =
      x: @mouseState.x
      y: @mouseState.y

    return if EJSON.equals currentPixelCoordinates, newPixelCoordinates

    @currentPixelCoordinates newPixelCoordinates

    @applyPencil()

  onMouseUp: (event) ->
