UI: Allow resetting transform of group sub-items

master
jp9000 2018-08-15 10:01:48 -07:00
parent a69f72654e
commit 07813e2bd0
1 changed files with 30 additions and 28 deletions

View File

@ -5509,10 +5509,10 @@ void OBSBasic::on_actionPasteTransform_triggered()
obs_scene_enum_items(GetCurrentScene(), func, nullptr);
}
void OBSBasic::on_actionResetTransform_triggered()
static bool reset_tr(obs_scene_t *scene, obs_sceneitem_t *item, void *param)
{
auto func = [] (obs_scene_t *scene, obs_sceneitem_t *item, void *param)
{
if (obs_sceneitem_is_group(item))
obs_sceneitem_group_enum_items(item, reset_tr, nullptr);
if (!obs_sceneitem_selected(item))
return true;
@ -5536,9 +5536,11 @@ void OBSBasic::on_actionResetTransform_triggered()
UNUSED_PARAMETER(scene);
UNUSED_PARAMETER(param);
return true;
};
}
obs_scene_enum_items(GetCurrentScene(), func, nullptr);
void OBSBasic::on_actionResetTransform_triggered()
{
obs_scene_enum_items(GetCurrentScene(), reset_tr, nullptr);
}
static void GetItemBox(obs_sceneitem_t *item, vec3 &tl, vec3 &br)