From: Carl Worth Date: Thu, 7 Nov 2013 21:14:56 +0000 (-0800) Subject: acre-x: Fix zooming so that zoom-in and zoom-out use the same amounts X-Git-Url: https://git.cworth.org/git?p=acre;a=commitdiff_plain;h=bacc5e501df0d3615dbe0aa8ef54b91ee3377b6e 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. --- 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; }