From c8866c580c60c16fd8fc3e14b5abebaec0060d8a Mon Sep 17 00:00:00 2001 From: Exeldro Date: Wed, 2 Oct 2024 07:25:24 +0200 Subject: [PATCH] Fix conversion of zoom --- CMakeLists.txt | 2 +- buildspec.json | 2 +- move-transition.c | 13 ++++++++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c7966e9..f3addba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ else() cmake_minimum_required(VERSION 3.18) endif() -project(move-transition VERSION 3.1.0) +project(move-transition VERSION 3.1.1) set(PROJECT_FULL_NAME "Move Transition") # Set new UUIDs when you start to create a new plugin. diff --git a/buildspec.json b/buildspec.json index 42b4434..2eb3c2e 100644 --- a/buildspec.json +++ b/buildspec.json @@ -79,5 +79,5 @@ } }, "name": "move-transition", - "version": "3.1.0" + "version": "3.1.1" } diff --git a/move-transition.c b/move-transition.c index 3a58ce1..623d05e 100644 --- a/move-transition.c +++ b/move-transition.c @@ -253,8 +253,18 @@ static void move_update(void *data, obs_data_t *settings) move->easing_function_in = obs_data_get_int(settings, S_EASING_FUNCTION_IN); move->easing_function_out = obs_data_get_int(settings, S_EASING_FUNCTION_OUT); move->position_in = obs_data_get_int(settings, S_POSITION_IN); + obs_data_item_t *item = obs_data_item_byname(settings, S_ZOOM_IN); + if (obs_data_item_gettype(item) == OBS_DATA_BOOLEAN) { + obs_data_set_double(settings, S_ZOOM_IN, obs_data_get_bool(settings, S_ZOOM_IN) ? 0.0 : 100.0); + } + obs_data_item_release(&item); move->zoom_in = (float)obs_data_get_double(settings, S_ZOOM_IN) / 100.0f; move->position_out = obs_data_get_int(settings, S_POSITION_OUT); + item = obs_data_item_byname(settings, S_ZOOM_IN); + if (obs_data_item_gettype(item) == OBS_DATA_BOOLEAN) { + obs_data_set_double(settings, S_ZOOM_OUT, obs_data_get_bool(settings, S_ZOOM_OUT) ? 0.0 : 100.0); + } + obs_data_item_release(&item); move->zoom_out = (float)obs_data_get_double(settings, S_ZOOM_OUT) / 100.0f; move->curve_move = (float)obs_data_get_double(settings, S_CURVE_MATCH); move->curve_in = (float)obs_data_get_double(settings, S_CURVE_IN); @@ -3253,6 +3263,7 @@ bool obs_module_load(void) return true; } -void obs_module_unload() { +void obs_module_unload() +{ pthread_mutex_destroy(&udp_servers_mutex); }