Skip to content

Commit

Permalink
libobs: Save crop to bounds when saving transform states
Browse files Browse the repository at this point in the history
(Lain note: Splitting parent commit. This was probably unintentionally
not taken into account in the origin crop_to_bounds PR.)
  • Loading branch information
exeldro authored and Lain-B committed Feb 21, 2024
1 parent f275080 commit 806c72f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libobs/obs-scene.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 806c72f

Please sign in to comment.