From b7da2dbcd87fbb167f2e76c113e7289564375c3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Sat, 20 Apr 2013 23:47:37 +0200 Subject: [PATCH] render_con: fix height rounding in aspect ratio computation With a 484x292 window and proportion of 488x294, new_height is 291.590164 after the loop, causing a rounding issue leading to a window of 484x291. --- src/render.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/render.c b/src/render.c index 6061838a..c0a0fedf 100644 --- a/src/render.c +++ b/src/render.c @@ -184,10 +184,10 @@ void render_con(Con *con, bool render_fullscreen) { new_width--; } /* Center the window */ - inset->y += ceil(inset->height / 2) - floor(new_height / 2); + inset->y += ceil(inset->height / 2) - floor((new_height + .5) / 2); inset->x += ceil(inset->width / 2) - floor(new_width / 2); - inset->height = new_height; + inset->height = new_height + .5; inset->width = new_width; }