UI, libobs: Add ability to lock individual scene items

Adds a lock checkbox to allow the user to lock a specific scene item.

Closes jp9000/obs-studio#949
This commit is contained in:
cg2121
2017-06-17 19:10:42 -05:00
committed by jp9000
parent 5c2328cca2
commit fce078d997
13 changed files with 144 additions and 0 deletions

View File

@@ -75,6 +75,8 @@ static bool FindItemAtPos(obs_scene_t *scene, obs_sceneitem_t *item,
if (!SceneItemHasVideo(item))
return true;
if (obs_sceneitem_locked(item))
return true;
vec3_set(&pos3, data->pos.x, data->pos.y, 0.0f);
@@ -674,6 +676,9 @@ void OBSBasicPreview::SnapItemMovement(vec2 &offset)
static bool move_items(obs_scene_t *scene, obs_sceneitem_t *item, void *param)
{
if (obs_sceneitem_locked(item))
return true;
vec2 *offset = reinterpret_cast<vec2*>(param);
if (obs_sceneitem_selected(item)) {
@@ -1084,6 +1089,9 @@ static inline bool crop_enabled(const obs_sceneitem_crop *crop)
bool OBSBasicPreview::DrawSelectedItem(obs_scene_t *scene,
obs_sceneitem_t *item, void *param)
{
if (obs_sceneitem_locked(item))
return true;
if (!obs_sceneitem_selected(item))
return true;
@@ -1183,6 +1191,7 @@ void OBSBasicPreview::DrawSceneEditing()
gs_technique_begin_pass(tech, 0);
OBSScene scene = main->GetCurrentScene();
if (scene)
obs_scene_enum_items(scene, DrawSelectedItem, this);