Center popup overlay instead of top-left anchored

This commit is contained in:
Andrew Hamilton 2026-08-15 07:57:08 +10:00
parent b8875f7292
commit 348c22ce4d

View file

@ -1104,7 +1104,8 @@ static void draw_tab_overlay(void) {
int box_h = n_rows * row_h + 2 * boxpad; int box_h = n_rows * row_h + 2 * boxpad;
if (box_w > host.width - 2 * margin) box_w = host.width - 2 * margin; if (box_w > host.width - 2 * margin) box_w = host.width - 2 * margin;
if (box_h > host.height - 2 * margin) box_h = host.height - 2 * margin; if (box_h > host.height - 2 * margin) box_h = host.height - 2 * margin;
int box_x = margin, box_y = margin; int box_x = (host.width - box_w) / 2;
int box_y = (host.height - box_h) / 2;
draw_rect(box_x, box_y, box_w, box_h, 0.07f, 0.07f, 0.09f, 1.0f); draw_rect(box_x, box_y, box_w, box_h, 0.07f, 0.07f, 0.09f, 1.0f);