Selection tool
Opened this issue · 0 comments
twlite commented
Rough design plan
// rectangular
const rectSelectionTool = layer.tools.get("RectangularSelectionTool");
const selection = rectSelectionTool.createSelection({
from: number;
to: number;
width: number;
height: number;
});
// rounded
const circularSelectionTool = layer.tools.get("RoundedSelectionTool");
const selection = circularSelectionTool.createSelection({
from: number;
to: number;
radius?: number;
});
// add polygonal selection??
// inverse selection
selection.inverse();
selection.copy(); // copy the selection config which can be used in other layers later
selection.deselect(); // deselect?
// register selection to the canvas
selection.make();
// we can now do different stuff with this selection such as copying pixels inside the selection/eraser, etc...
Perhaps, Path2D API would be helpful for this?