         directions: directions
         crop: (d for d in crop if crop)
     else if type == "up"
-      @mouseDownState = {}
-      if crop
-        [x, y, x1, y1] = crop
-        if x - x1 == 0 or y - y1 == 0
-          return null
+      if "x" == @mouseDownState?.directions
+        @mouseDownState = {}
+        return null
+      else
+        @mouseDownState = {}
+        if crop
+          [x, y, x1, y1] = crop
+          if x - x1 == 0 or y - y1 == 0
+            return null
     else if type == "move" and @mouseDownState?.x?
       if crop
         [x, y, x1, y1] = crop

        else
          cursor = "move"
          directions = "+"
    @cursor = cursor or "crosshair"
    if type == "down"
      if crop and not directions

        ctx.strokeRect(x-m, y1-m, 2*m, 2*m) # SW
        ctx.strokeRect(x + (x1-x)/2 -m, y1-m, 2*m, 2*m) # S
        ctx.strokeRect(x1-m, y1-m, 2*m, 2*m) # SE
        
        # Close handle
        ctx.strokeRect(x1+m, y-5*m, 4*m, 4*m)
        ctx.beginPath()
        ctx.moveTo(x1+m, y-5*m)
        ctx.lineTo(x1+5*m, y-m)
        ctx.stroke()
        ctx.beginPath()
        ctx.moveTo(x1+5*m, y-5*m)
        ctx.lineTo(x1+m, y-m)
        ctx.stroke()

  handleMouse: (mx, my, type, crop) =>
    directions = ""
