public void move(int offsetX, int offsetY) {
		CPRect srcRect;

		offsetX += movePrevX;
		offsetY += movePrevY;

		if (moveInitSelect == null) {
			srcRect = getSelectionAutoSelect();
			if (!getSelection().isEmpty()) {
				moveInitSelect = getSelection();
			}
		} else {
			srcRect = (CPRect) moveInitSelect.clone();
		}
		curLayer.copyFrom(undoBuffer);

		if (!moveModeCopy) {
			curLayer.clear(srcRect, 0);
		}

		curLayer.pasteAlphaRect(undoBuffer, srcRect, srcRect.left + offsetX, srcRect.top + offsetY);

		undoArea = new CPRect();
		if (!moveModeCopy) {
			undoArea.union(srcRect);
		}
		srcRect.translate(offsetX, offsetY);
		undoArea.union(srcRect);

		invalidateFusion();

		if (moveInitSelect != null) {
			CPRect sel = (CPRect) moveInitSelect.clone();
			sel.translate(offsetX, offsetY);
			setSelection(sel);
		}

		// this is a really bad idea :D
		movePrevX2 = offsetX;
		movePrevY2 = offsetY;
	}