public void pasteClip(boolean createUndo, CPClip clip) {
		if (createUndo) {
			addUndo(new CPUndoPaste(clip, getActiveLayerNb(), getSelection()));
		}

		// FIXME: redundant code, should use AddLayer's code??
		CPLayer newLayer = new CPLayer(width, height);
		newLayer.name = getDefaultLayerName();
		layers.add(activeLayer + 1, newLayer);
		setActiveLayer(activeLayer + 1);

		CPRect r = clip.bmp.getSize();
		int x, y;
		if (r.isInside(getSize())) {
			x = clip.x;
			y = clip.y;
		} else {
			x = (width - clip.bmp.width) / 2;
			y = (height - clip.bmp.height) / 2;
		}

		curLayer.pasteBitmap(clip.bmp, x, y);
		emptySelection();

		invalidateFusion();
		callListenersLayerChange();
	}