requesthandler: Add cropToBounds to scene item

This commit is contained in:
Exeldro 2024-05-17 08:30:11 +02:00 committed by tt2468
parent acd1af12a1
commit 36f50adf8a
2 changed files with 9 additions and 0 deletions

View File

@ -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.");

View File

@ -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;
}