From b7100d57160d2ae7a38d5517f1c2cd7155737d88 Mon Sep 17 00:00:00 2001 From: Ronan Pigott Date: Fri, 14 Jul 2023 16:53:50 -0700 Subject: render: use rounding for fractional scale If we truncate the buffer dimensions we may accidentally submit a buffer with inappropriate size. --- render.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'render.c') diff --git a/render.c b/render.c index 677856d8..d084a859 100644 --- a/render.c +++ b/render.c @@ -3856,8 +3856,8 @@ maybe_resize(struct terminal *term, int width, int height, bool force) scale = term->scale; } - width *= scale; - height *= scale; + width = round(width * scale); + height = round(height * scale); if (width == 0 && height == 0) { /* -- cgit v1.3