render: use rounding for fractional scale

If we truncate the buffer dimensions we may accidentally submit a
buffer with inappropriate size.
This commit is contained in:
Ronan Pigott 2023-07-14 16:53:50 -07:00
parent d1df98e0ca
commit b7100d5716
4 changed files with 12 additions and 4 deletions

View file

@ -401,7 +401,9 @@ update_term_for_output_change(struct terminal *term)
float old_scale = term->scale;
render_resize(term, term->width / term->scale, term->height / term->scale);
render_resize(term,
round(term->width / term->scale),
round(term->height / term->scale));
term_font_dpi_changed(term, old_scale);
term_font_subpixel_changed(term);
csd_reload_font(term->window, old_scale);