hud: only increase y if the pane contains graphs

This makes the layout of "fps,cpu" identical to "fps,stdout,cpu".
Without this change, the ',' separator after 'stdout' would increase
y and we would have a gap between the fps and cpu graphs.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38925>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2025-12-12 15:10:32 +01:00 committed by Marge Bot
parent f521a6270b
commit 3b4b5761aa

View file

@ -1508,14 +1508,15 @@ hud_parse_env_var(struct hud_context *hud, struct pipe_screen *screen,
if (!pane)
break;
y += height + hud->font.glyph_height * (pane->num_graphs + 2);
y_simple += hud->font.glyph_height * (pane->num_graphs + 1);
height = 100;
if (pane && pane->num_graphs) {
y += height + hud->font.glyph_height * (pane->num_graphs + 2);
y_simple += hud->font.glyph_height * (pane->num_graphs + 1);
list_addtail(&pane->head, &hud->pane_list);
pane = NULL;
}
height = 100;
break;
case ';':