import { Layer } from 'konva/lib/Layer';
import Konva from 'konva/lib';

export const rect1 = (parent: Layer) => {
	const rect = new Konva.Rect({
		x: 60,
		y: 60,
		width: 100,
		height: 90,
		fill: 'red',
		name: 'rect',
		draggable: true,
	});

	parent.add(rect);
	return rect;
};
export const rect2 = (parent: Layer) => {
	const rect = new Konva.Rect({
		x: 180,
		y: 200,
		width: 100,
		height: 200,
		fill: 'green',
		name: 'rect',
		draggable: true,
	});

	parent.add(rect);
	return rect;
};

export const selectionRectangle = (layer: Layer) => {
	const selectionRectangle = new Konva.Rect({
		fill: 'rgba(0,0,255,0.5)',
		visible: false,
		listening: false,
	});
	layer.add(selectionRectangle);
	return selectionRectangle;
};
