code: function () {
  		this.requires("Mouse");
  		
  		this._ondrag = function (e) {
  			var pos = Crafty.DOM.translate(e.clientX, e.clientY);
  
  			// ignore invalid 0 0 position - strange problem on ipad
  			if (pos.x == 0 || pos.y == 0) {
  			    return false;
  			}
  	    
  			if(this._dir) {
  			    var len = (pos.x - this._origMouseDOMPos.x) * this._dir.x + (pos.y - this._origMouseDOMPos.y) * this._dir.y;
  			    this.x = this._oldX + len * this._dir.x;
  			    this.y = this._oldY + len * this._dir.y;
  			} else {
  			    this.x = this._oldX + (pos.x - this._origMouseDOMPos.x);
  			    this.y = this._oldY + (pos.y - this._origMouseDOMPos.y);
  			}
  	    
  			this.trigger("Dragging", e);
  		};
  
  		this._ondown = function (e) {
  			if (e.mouseButton !== Crafty.mouseButtons.LEFT) return;
  			this._startDrag(e);
  		};
  
  		this._onup = function upper(e) {
  			if (this._dragging == true) {
  			    Crafty.removeEvent(this, Crafty.stage.elem, "mousemove", this._ondrag);
  			    Crafty.removeEvent(this, Crafty.stage.elem, "mouseup", this._onup);
  			    this._dragging = false;
  			    this.trigger("StopDrag", e);
  			}
  		};
  
  		this.enableDrag();
  	}
docs: Note: the code is note tested with zoom, etc., that may distort the direction between the viewport and the coordinate on the canvas.