aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorRonan Pigott <ronan@rjp.ie>2023-07-14 23:53:50 +0000
committerRonan Pigott <ronan@rjp.ie>2023-07-16 03:03:16 +0000
commitb7100d57160d2ae7a38d5517f1c2cd7155737d88 (patch)
tree94562102e5982602d8dcdd02b777134ee5a1db71 /render.c
parentchangelog: add new ‘unreleased’ section (diff)
render: use rounding for fractional scale
If we truncate the buffer dimensions we may accidentally submit a buffer with inappropriate size.
Diffstat (limited to 'render.c')
-rw-r--r--render.c4
1 files changed, 2 insertions, 2 deletions
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) {
/*