libobs: Fix setting non-0 order on only scene item
This commit is contained in:
parent
1bf84a6901
commit
a19945b53a
1 changed files with 3 additions and 3 deletions
|
|
@ -2908,7 +2908,6 @@ void obs_sceneitem_set_order_position(obs_sceneitem_t *item, int position)
|
|||
return;
|
||||
|
||||
struct obs_scene *scene = obs_scene_get_ref(item->parent);
|
||||
struct obs_scene_item *next;
|
||||
|
||||
if (!scene)
|
||||
return;
|
||||
|
|
@ -2916,11 +2915,12 @@ void obs_sceneitem_set_order_position(obs_sceneitem_t *item, int position)
|
|||
full_lock(scene);
|
||||
|
||||
detach_sceneitem(item);
|
||||
next = scene->first_item;
|
||||
|
||||
if (position == 0) {
|
||||
if (!scene->first_item || position == 0) {
|
||||
attach_sceneitem(scene, item, NULL);
|
||||
} else {
|
||||
struct obs_scene_item *next = scene->first_item;
|
||||
|
||||
for (int i = position; i > 1; --i) {
|
||||
if (next->next == NULL)
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue