summaryrefslogtreecommitdiff
path: root/src/static-ui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/static-ui.cpp')
-rw-r--r--src/static-ui.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/static-ui.cpp b/src/static-ui.cpp
index f80c000..b4bdc5c 100644
--- a/src/static-ui.cpp
+++ b/src/static-ui.cpp
@@ -575,17 +575,15 @@ void pke_ui_tick(double delta) {
// This currently only calls tear-down for boxes on the root list.
// Leaving this as-is for the time being because you can control the
// visibility of child boxes with flags and don't need to completely remove them.
- for (u = 0; u < EntitiesToBeRemoved.next; ++u) {
- if (EntitiesToBeRemoved[u] == box) {
- pke_ui_teardown_box_recursive(box);
- for (ii = 0; i + ii + 1 < pke_ui_master.r_root_boxes; ++ii) {
- pke_ui_master.root_boxes[i + ii] = pke_ui_master.root_boxes[i + ii + 1];
- }
- pke_ui_master.h_root_boxes -= 1;
- i -= 1;
- pke_ui_master.should_update_buffer = true;
- goto skip_calc;
+ if (box->isMarkedForRemoval == true) {
+ pke_ui_teardown_box_recursive(box);
+ for (ii = 0; i + ii + 1 < pke_ui_master.r_root_boxes; ++ii) {
+ pke_ui_master.root_boxes[i + ii] = pke_ui_master.root_boxes[i + ii + 1];
}
+ pke_ui_master.h_root_boxes -= 1;
+ i -= 1;
+ pke_ui_master.should_update_buffer = true;
+ goto skip_calc;
}
pke_ui_calc_px(arr, tmp_txtr_arr, nullptr, box);
pke_ui_recalc_sizes_recursive(arr, tmp_txtr_arr, box);