Skip to content

Commit 36f50ad

Browse files
exeldrott2468
authored andcommitted
requesthandler: Add cropToBounds to scene item
1 parent acd1af1 commit 36f50ad

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/requesthandler/RequestHandler_SceneItems.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,13 @@ RequestResult RequestHandler::SetSceneItemTransform(const Request &request)
502502
cropChanged = true;
503503
}
504504

505+
if (r.Contains("cropToBounds")) {
506+
if (!r.ValidateOptionalBoolean("cropToBounds", statusCode, comment))
507+
return RequestResult::Error(statusCode, comment);
508+
sceneItemTransform.crop_to_bounds = r.RequestData["cropToBounds"];
509+
transformChanged = true;
510+
}
511+
505512
if (!transformChanged && !cropChanged)
506513
return RequestResult::Error(RequestStatus::CannotAct, "You have not provided any valid transform changes.");
507514

src/utils/Obs_ObjectHelper.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,7 @@ json Utils::Obs::ObjectHelper::GetSceneItemTransform(obs_sceneitem_t *item)
8383
ret["cropTop"] = (int)crop.top;
8484
ret["cropBottom"] = (int)crop.bottom;
8585

86+
ret["cropToBounds"] = osi.crop_to_bounds;
87+
8688
return ret;
8789
}

0 commit comments

Comments
 (0)