render: always center grid when fullscreened or maximized

This commit is contained in:
Daniel Eklöf 2024-02-13 16:28:03 +01:00
parent fa01bf2b75
commit c114afadbd
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 7 additions and 1 deletions

View file

@ -4060,7 +4060,11 @@ render_resize(struct terminal *term, int width, int height, uint8_t opts)
const int total_x_pad = term->width - grid_width;
const int total_y_pad = term->height - grid_height;
if (term->conf->center && !term->window->is_resizing) {
const bool centered_padding = term->conf->center
|| term->window->is_fullscreen
|| term->window->is_maximized;
if (centered_padding && !term->window->is_resizing) {
term->margins.left = total_x_pad / 2;
term->margins.top = total_y_pad / 2;
} else {