         image.draw @tmpCtx, @mesh
         @blendFunction @ctx, @tmpCanvas, image.weight
       @trigger 'draw', this, @canvas
+    @requestID = null
 
   updateCanvasSize: =>
     w = 0

  tmpCtx: null

  blendFunction: null
  

  constructor: (params = {}) ->
    @images = []

  # drawing

  draw: =>
    return if @requestID?
    requestFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame || window.webkitRequestAnimationFrame
    if requestFrame?
      @requestID = requestFrame @drawNow
    else
      @drawNow()

  drawNow: =>
    @canvas.width = @canvas.width
    @updateCanvasSize()
    @updateMesh()
