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.
}
else if (keycode == minus_code)
{
}
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;
}
x_min -= shift;
x_max += shift;
}