mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
requesthandler: Add cropToBounds
to scene item
This commit is contained in:
parent
acd1af12a1
commit
36f50adf8a
@ -502,6 +502,13 @@ RequestResult RequestHandler::SetSceneItemTransform(const Request &request)
|
|||||||
cropChanged = true;
|
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)
|
if (!transformChanged && !cropChanged)
|
||||||
return RequestResult::Error(RequestStatus::CannotAct, "You have not provided any valid transform changes.");
|
return RequestResult::Error(RequestStatus::CannotAct, "You have not provided any valid transform changes.");
|
||||||
|
|
||||||
|
@ -83,5 +83,7 @@ json Utils::Obs::ObjectHelper::GetSceneItemTransform(obs_sceneitem_t *item)
|
|||||||
ret["cropTop"] = (int)crop.top;
|
ret["cropTop"] = (int)crop.top;
|
||||||
ret["cropBottom"] = (int)crop.bottom;
|
ret["cropBottom"] = (int)crop.bottom;
|
||||||
|
|
||||||
|
ret["cropToBounds"] = osi.crop_to_bounds;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user