mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
render: don't center grid on surface
Up until now, we've centered the grid on the main surface. Meaning, we calculated the unusable area, added the user configured padding and then centered the grid. This may look nice at first, but doesn't anymore when you start resizing the window. Resizing the window will cause the top+left margins to change, which makes the text "jump" or "wobble". So, now we fix the grid in the upper left corner defined by the user configured padding (plus CSDs if they aren't positioned outside the main surface).
This commit is contained in:
parent
6ca880bd3e
commit
90efe6ec02
1 changed files with 2 additions and 2 deletions
4
render.c
4
render.c
|
|
@ -1225,8 +1225,8 @@ maybe_resize(struct terminal *term, int width, int height, bool force)
|
|||
assert(new_rows >= 1);
|
||||
|
||||
/* Margins */
|
||||
term->margins.left = csd_border + (term->width - csd_x - new_cols * term->cell_width) / 2;
|
||||
term->margins.top = csd_border + csd_title + (term->height - csd_y - new_rows * term->cell_height) / 2;
|
||||
term->margins.left = csd_border + pad_x;
|
||||
term->margins.top = csd_border + csd_title + pad_y;
|
||||
term->margins.right = term->width - new_cols * term->cell_width - term->margins.left;
|
||||
term->margins.bottom = term->height - new_rows * term->cell_height - term->margins.top;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue