 
     return
 
-  mouseup: (pos) ->
+  mouseup: (pos, t) ->
     if @dropdown_menu?
       if @dropdown_menu.selected >= 0
-        @dropdown_menu.options[@dropdown_menu.selected].action(this)
+        @dropdown_menu.options[@dropdown_menu.selected].action(this, t)
       @dropdown_menu = null
       return
 
     if @selected?
-      if Date.now() - @selected.t < 200
+      if t - @selected.t < 200
         mdx = pos.x - @selected.mx
         mdy = pos.y - @selected.my
         if mdx*mdx+mdy*mdy < 10*10

    collection.mousemove(pos)

canvas.addEventListener 'mouseup', (e) ->
  pos = getCursorPosition(canvas, e)
  for collection in collections
    collection.mouseup(pos)

    context.fillText(pendingString, 0, canvas.height - 32)

  for collection, idx in collections
    collection.render(context, idx, t)

  for collection, idx in collections
    collection.render_overlay(context, idx, t)

  window.requestAnimationFrame(render)

