frontend: Improve scene item cropping UI#12383
frontend: Improve scene item cropping UI#12383Warchamp7 wants to merge 1 commit intoobsproject:masterfrom
Conversation
cea98c1 to
4399ec1
Compare
|
In my tests this doesn't work right: When cropping a source only a fixed rectangular area in the top left is overlaid over the preview, the rest of the preview is unaffected. The implementation itself also seems wasteful to me in terms of GPU draw calls. IMO this should be done with a fragment shader that effectively renders the source with the canvas resolution. The shader would either:
That should result in a single draw call for everything and because the source is rendered at the full canvas width, it would be blended directly into the render target. Maybe @Lain-B has an idea how to make that work as it kinda runs counter to how the projection matrix is set up for sources, but it would shift the coverage calculations out of the UI code and into the shader, similar to how we made the striped line work entirely in the shader. |
Can you post an image or video of it's behavior for you?
Is that concern a blocker to this PR?
You mean the striped lines for cropping. Not the striped overlay for sources outside the canvas. |
|
Converted to draft until @Lain-B or @PatTheMav has time to dig into what's going funky with the render code here, as well as investigate ways we can do this more efficiently. |

Description
Makes a number of improvements to cropping items via a new visual UI.
While Alt is held down with a source selected, a dark overlay is drawn over the preview along with showing the cropped out regions of the source. The stretch handles also change to green to help indicate that a different action will take place when dragging one.
Dragging the source with Alt held down will now move the source within the cropped region.

Motivation and Context
Cropping can be a bit unintuitive when using alternative bounding box types. I wanted to improve that as well as give a visual aid to exactly what is outside the cropped area.
obs64_torQYPUrcX.mp4
How Has This Been Tested?
Tested cropping a source on all sides, in all bounding box types, and with all bounding box alignments.
Types of changes
Checklist: