diff --git a/src/ui/ui_core.c b/src/ui/ui_core.c index adbf7fa5..535bdff7 100644 --- a/src/ui/ui_core.c +++ b/src/ui/ui_core.c @@ -875,22 +875,19 @@ void UI_EndFrame(UI_Frame *frame) } /* Update parent */ - if (box->parent != parent) + if (box->parent) { - if (box->parent) - { - /* Remove from old parent */ - DllQueueRemove(box->parent->first, box->parent->last, box); - --box->parent->count; - } - if (parent) - { - /* Add to new parent */ - DllQueuePush(parent->first, parent->last, box); - ++parent->count; - } - box->parent = parent; + /* Remove from old parent */ + DllQueueRemove(box->parent->first, box->parent->last, box); + --box->parent->count; } + if (parent) + { + /* Add to new parent */ + DllQueuePush(parent->first, parent->last, box); + ++parent->count; + } + box->parent = parent; /* Update box */ {