Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

Selection tool #33

@twlite

Description

@twlite

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?

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions