   draw: (e) ->
     markLeftX = Math.max @startingPoint - @maxWidth(), Math.min @startingPoint, @toCanvasXPoint(e)
     markRightX = Math.max @startingPoint, @toCanvasXPoint(e)
+
 
     width = (Math.min (Math.max (Math.abs markRightX - markLeftX), @minWidth()), @maxWidth())
 

    mark.element.outerHTML = "" for mark in @all
    @all = []

class Mark
  constructor: (e, @canvasGraph) ->
    @canvas = @canvasGraph.canvas


    $(document).trigger("mark-change")

  toCanvasXPoint: (e) -> e.pageX - @canvas.getBoundingClientRect().left - window.scrollX

module?.exports = CanvasGraph: CanvasGraph, Marks: Marks, Mark: Mark
