From bacc5e501df0d3615dbe0aa8ef54b91ee3377b6e Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 7 Nov 2013 13:14:56 -0800 Subject: [PATCH] acre-x: Fix zooming so that zoom-in and zoom-out use the same amounts The intent was always that one zoom-in followed by one zoom-out, (or vice versa) would lead to the original zoom level. But the zoom-out code had some incorrect arithmetic in it such that zooming out was much faster than zooming in. --- acre-x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acre-x.c b/acre-x.c index 194926a..c375c36 100644 --- a/acre-x.c +++ b/acre-x.c @@ -154,7 +154,7 @@ handle_events(Display *dpy, Window window, Visual *visual, } else if (keycode == minus_code) { - shift = (1- 2*ZOOM) * (x_max - x_min); + shift = (ZOOM/(1 - 2 * ZOOM)) * (x_max - x_min); x_min -= shift; x_max += shift; } -- 2.43.0