From 1018367499be2e0fe822462728d8c157eecd3326 Mon Sep 17 00:00:00 2001 From: Ilia Date: Wed, 9 Feb 2022 11:57:11 +0300 Subject: [PATCH] fix: calculating width of x axis --- src/wasm/mandelbrot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wasm/mandelbrot.cpp b/src/wasm/mandelbrot.cpp index b1b934e..aa70de6 100644 --- a/src/wasm/mandelbrot.cpp +++ b/src/wasm/mandelbrot.cpp @@ -73,7 +73,7 @@ EMSCRIPTEN_KEEPALIVE #endif void calcPlane(double lx, double rx, int width, int height, short* result) { // total width of x axis (complex plane) - double xwidth = std::abs(lx) + std::abs(rx); + double xwidth = rx - lx; // scale coefficient between complex plane and canvas double scale = width / xwidth;