From b13db60ef32244d108bf93a3202dee96d6103a1f Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Sun, 8 May 2011 18:53:28 +0300 Subject: [PATCH] Fix broken aspect ratio calculation One must use floating point division Signed-off-by: Timo Kokkonen --- mandelbrot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mandelbrot.c b/mandelbrot.c index a00be93..9ca2421 100644 --- a/mandelbrot.c +++ b/mandelbrot.c @@ -163,7 +163,7 @@ static void loop(struct context *ctx) int last_zoom; do { - aspect_ratio = ctx->screen->w / ctx->screen->h; + aspect_ratio = ctx->screen->w / (long double)ctx->screen->h; ctx->origo_x += ctx->motion_x / ctx->zoom / ctx->screen->w; ctx->origo_y += ctx->motion_y / ctx->zoom / ctx->screen->h; ctx->motion_x = ctx->motion_y = 0; -- 2.44.0