diff --git a/src/requesthandler/RequestHandler_SceneItems.cpp b/src/requesthandler/RequestHandler_SceneItems.cpp index 67c5333a..146fb654 100644 --- a/src/requesthandler/RequestHandler_SceneItems.cpp +++ b/src/requesthandler/RequestHandler_SceneItems.cpp @@ -502,6 +502,13 @@ RequestResult RequestHandler::SetSceneItemTransform(const Request &request) cropChanged = true; } + if (r.Contains("cropToBounds")) { + if (!r.ValidateOptionalBoolean("cropToBounds", statusCode, comment)) + return RequestResult::Error(statusCode, comment); + sceneItemTransform.crop_to_bounds = r.RequestData["cropToBounds"]; + transformChanged = true; + } + if (!transformChanged && !cropChanged) return RequestResult::Error(RequestStatus::CannotAct, "You have not provided any valid transform changes."); diff --git a/src/utils/Obs_ObjectHelper.cpp b/src/utils/Obs_ObjectHelper.cpp index e35c28bf..10f207e5 100644 --- a/src/utils/Obs_ObjectHelper.cpp +++ b/src/utils/Obs_ObjectHelper.cpp @@ -83,5 +83,7 @@ json Utils::Obs::ObjectHelper::GetSceneItemTransform(obs_sceneitem_t *item) ret["cropTop"] = (int)crop.top; ret["cropBottom"] = (int)crop.bottom; + ret["cropToBounds"] = osi.crop_to_bounds; + return ret; }