Skip to content

Conversation

po5
Copy link

@po5 po5 commented Sep 18, 2022

This lets users hold and drag to select a crop area.
The window-dragging property is temporarily set to no, can be disabled with a script opt.
After dragging, releasing left mouse will submit the crop.
It is still possible to do a simple left click to set each crop corner individually.

@occivink
Copy link
Owner

Sounds good, but I would like it to check the state of the property on down event, and only re-enable it if it was actually enabled.

@po5
Copy link
Author

po5 commented Sep 19, 2022

True, will do that.

dexeonify pushed a commit to dexeonify/mpv-config that referenced this pull request Sep 14, 2025
Second take of 0f2ea30 because I noticed Sneakpeakcss didn't fully
implement click-and-drag crop selection exactly as in the original PR.
Previously, you had to click the first point before you can hold and
drag to crop.

This commit integrates po5's complex keybinds changes, allowing you to
start, select and submit the crop in a single hold-and-drag operation!

One of the roadblock to patching po5's PR directly was the condition
`or (crop_first_corner.x == corner_video.x and crop_first_corner.y ==
corner_video.y)`. It was causing errors due to a missing `corner_video`
variable, which was removed in occivink/mpv-scripts@af360f3. Thus, I've
partially restored the variable to fix this.

Note: Unlike Sneakpeakcss's version, click-and-drag and point-and-click
are mutually exclusive. You can't click to start the crop, then
hold-and-drag to select the area. It was unintuitive anyways.

Ref: occivink/mpv-scripts#62
dexeonify pushed a commit to dexeonify/mpv-config that referenced this pull request Sep 20, 2025
Second take of d5306ca because I noticed Sneakpeakcss didn't fully
implement click-and-drag crop selection exactly as in the original PR.
Previously, you had to click the first point before you can hold and
drag to crop.

This commit integrates po5's complex keybinds changes, allowing you to
start, select and submit the crop in a single hold-and-drag operation!

One of the roadblock to patching po5's PR directly was the condition
`or (crop_first_corner.x == corner_video.x and crop_first_corner.y ==
corner_video.y)`. It was causing errors due to a missing `corner_video`
variable, which was removed in occivink/mpv-scripts@af360f3. Thus, I've
partially restored the variable to fix this.

Note: Unlike Sneakpeakcss's version, click-and-drag and point-and-click
are mutually exclusive. You can't click to start the crop, then
hold-and-drag to select the area. It was unintuitive anyways.

Ref: occivink/mpv-scripts#62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants