From 806c72fc662c2476d79edbd837b073187af33411 Mon Sep 17 00:00:00 2001 From: Exeldro Date: Tue, 20 Feb 2024 20:58:52 -0600 Subject: [PATCH] libobs: Save crop to bounds when saving transform states (Lain note: Splitting parent commit. This was probably unintentionally not taken into account in the origin crop_to_bounds PR.) --- libobs/obs-scene.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libobs/obs-scene.c b/libobs/obs-scene.c index b8bf01f52537f6..9b51956aeadd7b 100644 --- a/libobs/obs-scene.c +++ b/libobs/obs-scene.c @@ -2415,6 +2415,7 @@ bool save_transform_states(obs_scene_t *scene, obs_sceneitem_t *item, uint32_t alignment = info.alignment; uint32_t bounds_type = info.bounds_type; uint32_t bounds_alignment = info.bounds_alignment; + bool crop_to_bounds = info.crop_to_bounds; struct vec2 bounds = info.bounds; obs_data_set_int(temp, "id", obs_sceneitem_get_id(item)); @@ -2425,6 +2426,7 @@ bool save_transform_states(obs_scene_t *scene, obs_sceneitem_t *item, obs_data_set_int(temp, "bounds_type", bounds_type); obs_data_set_vec2(temp, "bounds", &bounds); obs_data_set_int(temp, "bounds_alignment", bounds_alignment); + obs_data_set_bool(temp, "crop_to_bounds", crop_to_bounds); obs_data_set_int(temp, "top", crop.top); obs_data_set_int(temp, "bottom", crop.bottom); obs_data_set_int(temp, "left", crop.left); @@ -2511,6 +2513,7 @@ void load_transform_states(obs_data_t *temp, void *vp_scene) info.bounds_alignment = (uint32_t)obs_data_get_int(temp, "bounds_alignment"); obs_data_get_vec2(temp, "bounds", &info.bounds); + info.crop_to_bounds = obs_data_get_bool(temp, "crop_to_bounds"); crop.top = (int)obs_data_get_int(temp, "top"); crop.bottom = (int)obs_data_get_int(temp, "bottom"); crop.left = (int)obs_data_get_int(temp, "left");