From d6969d7732f6d876c5007e836c1614c702ad7ddd Mon Sep 17 00:00:00 2001 From: Clayton Groeneveld Date: Mon, 17 Feb 2020 13:01:04 -0600 Subject: [PATCH] UI: Fix locked sources being transformed --- UI/window-basic-main.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 0ec29df9c..d776bc66e 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -4536,6 +4536,7 @@ void OBSBasic::CreateSourcePopupMenu(int idx, bool preview) popup.addSeparator(); OBSSceneItem sceneItem = ui->sources->Get(idx); + bool lock = obs_sceneitem_locked(sceneItem); obs_source_t *source = obs_sceneitem_get_source(sceneItem); uint32_t flags = obs_source_get_output_flags(source); bool isAsyncVideo = (flags & OBS_SOURCE_ASYNC_VIDEO) == @@ -4556,6 +4557,18 @@ void OBSBasic::CreateSourcePopupMenu(int idx, bool preview) popup.addMenu(ui->orderMenu); popup.addMenu(ui->transformMenu); + ui->actionResetTransform->setEnabled(!lock); + ui->actionRotate90CW->setEnabled(!lock); + ui->actionRotate90CCW->setEnabled(!lock); + ui->actionRotate180->setEnabled(!lock); + ui->actionFlipHorizontal->setEnabled(!lock); + ui->actionFlipVertical->setEnabled(!lock); + ui->actionFitToScreen->setEnabled(!lock); + ui->actionStretchToScreen->setEnabled(!lock); + ui->actionCenterToScreen->setEnabled(!lock); + ui->actionVerticalCenter->setEnabled(!lock); + ui->actionHorizontalCenter->setEnabled(!lock); + sourceProjector = new QMenu(QTStr("SourceProjector")); AddProjectorMenuMonitors(sourceProjector, this, SLOT(OpenSourceProjector())); @@ -6154,6 +6167,8 @@ static bool reset_tr(obs_scene_t *scene, obs_sceneitem_t *item, void *param) obs_sceneitem_group_enum_items(item, reset_tr, nullptr); if (!obs_sceneitem_selected(item)) return true; + if (obs_sceneitem_locked(item)) + return true; obs_sceneitem_defer_update_begin(item); @@ -6231,6 +6246,8 @@ static bool RotateSelectedSources(obs_scene_t *scene, obs_sceneitem_t *item, param); if (!obs_sceneitem_selected(item)) return true; + if (obs_sceneitem_locked(item)) + return true; float rot = *reinterpret_cast(param); @@ -6279,6 +6296,8 @@ static bool MultiplySelectedItemScale(obs_scene_t *scene, obs_sceneitem_t *item, param); if (!obs_sceneitem_selected(item)) return true; + if (obs_sceneitem_locked(item)) + return true; vec3 tl = GetItemTL(item); @@ -6322,6 +6341,8 @@ static bool CenterAlignSelectedItems(obs_scene_t *scene, obs_sceneitem_t *item, param); if (!obs_sceneitem_selected(item)) return true; + if (obs_sceneitem_locked(item)) + return true; obs_video_info ovi; obs_get_video_info(&ovi); @@ -6376,6 +6397,8 @@ static bool center_to_scene(obs_scene_t *, obs_sceneitem_t *item, void *param) ¢erType); if (!obs_sceneitem_selected(item)) return true; + if (obs_sceneitem_locked(item)) + return true; obs_get_video_info(&ovi); obs_sceneitem_get_info(item, &oti);