Skip to content

feature: allow edit selection area - #124

Merged
Decodetalkers merged 4 commits into
waycrate:masterfrom
Gigas002:feature/area-selector-tweak
Jul 26, 2026
Merged

feature: allow edit selection area#124
Decodetalkers merged 4 commits into
waycrate:masterfrom
Gigas002:feature/area-selector-tweak

Conversation

@Gigas002

Copy link
Copy Markdown
Member

This PR adds a new feature to edit the selected area before printing the resulting output.
To be more precise, the code allows changing selection rectangle bounds, allows dragging rectangle around, shows crosshair cursor when in selection area.
The code is behind a new flags: --edit-selection/-e and --edit-selection-key <keycode>. Since this doesn't introduce any new deps I decided that it'd be an overkill to separate it behind cargo feat.The consumers that doesn't use this feat will not be affected by this change.

Closes: #6

2026-07-25.23-29-20.mp4

One thing I only not sure is, the out of bounds cases. By dragging rectangle out of screen we can see the negative/overflow values:

2026-07-25.23-31-10.mp4

For consumers (e.g. wayshot) that expects a correct string, out-of-bounds results will result in panic. I wonder, if we should add a guards here, like setting making negative values to 0 before outputting them, or it is fine as-is.

@Gigas002
Gigas002 requested a review from Decodetalkers July 25, 2026 14:34
@Gigas002 Gigas002 self-assigned this Jul 25, 2026

@Decodetalkers Decodetalkers left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Decodetalkers

Copy link
Copy Markdown
Collaborator

Looks fine. merge it

@Decodetalkers
Decodetalkers merged commit bf521a2 into waycrate:master Jul 26, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Allow changing rectangle sizes, position and re-create rectangle before collecting region bounds

2 participants