 TICK_INTERVAL = 30
 
 T_CONST = 325
+
+AMPLITUDE_CONST = 0.55
+MAX_EDGE_VELOCITY = 1000
 
 ###*
 # Start the view scrolling.

stopKineticScrolling = ->
  clearInterval scrollTicker
  if Math.abs(velocity) > 10
    amplitude = 0.8 * velocity
    target = Math.round(offset + amplitude)
    scrollTimestamp = Date.now()
    requestAnimationFrame => autoScroll.call @


  if amplitude
    elapsed = Date.now() - scrollTimestamp
    delta = -amplitude * Math.exp(-elapsed / T_CONST)

    if Math.abs(delta) > 0.5

      if target is min or target is max
        t = target - delta
      else
        t = target + delta

      scroll.call @, t
      requestAnimationFrame => autoScroll.call @
    else
      scroll.call @, target
