From 01ac60c760a0bfb806f7275432091e0973957dd7 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Wed, 18 Jul 2018 22:04:32 -0700 Subject: [PATCH] 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. --- UI/window-basic-preview.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/UI/window-basic-preview.cpp b/UI/window-basic-preview.cpp index d1e89a26c..a01527a29 100644 --- a/UI/window-basic-preview.cpp +++ b/UI/window-basic-preview.cpp @@ -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); } -- GitLab