UI: Allow alt-cropping on bounding box scene items
Allows the use of alt-cropping on scene items that have bounding box enabled. The crop will simply apply to the source within the bounding box rather than try to do anything fancy. A simple solution to an annoying problem.
This commit is contained in:
@@ -928,9 +928,6 @@ void OBSBasicPreview::CropItem(const vec2 &pos)
|
||||
uint32_t align = obs_sceneitem_get_alignment(stretchItem);
|
||||
vec3 tl, br, pos3;
|
||||
|
||||
if (boundsType != OBS_BOUNDS_NONE) /* TODO */
|
||||
return;
|
||||
|
||||
vec3_zero(&tl);
|
||||
vec3_set(&br, stretchItemSize.x, stretchItemSize.y, 0.0f);
|
||||
|
||||
@@ -1035,7 +1032,8 @@ void OBSBasicPreview::CropItem(const vec2 &pos)
|
||||
|
||||
obs_sceneitem_defer_update_begin(stretchItem);
|
||||
obs_sceneitem_set_crop(stretchItem, &crop);
|
||||
obs_sceneitem_set_pos(stretchItem, (vec2*)&newPos);
|
||||
if (boundsType == OBS_BOUNDS_NONE)
|
||||
obs_sceneitem_set_pos(stretchItem, (vec2*)&newPos);
|
||||
obs_sceneitem_defer_update_end(stretchItem);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user