]> git.itanic.dy.fi Git - mandelbrot/blobdiff - mandelbrot.c
Fix broken aspect ratio calculation
[mandelbrot] / mandelbrot.c
index a00be93beec714c0b81b177cf3cdaf4a548e2140..9ca242101ae1bad4a2f98aa5e89387dee82f36f0 100644 (file)
@@ -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;