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.)
This commit is contained in:
Exeldro
2024-02-20 20:58:52 -06:00
committed by Lain
parent f275080abb
commit 806c72fc66
+3
View File
@@ -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");