draw (dpy, window, visual, acre,
width, height, x_min, x_max);
+#define PAN 0.05
+#define ZOOM PAN
XNextEvent (dpy, &xev);
switch (xev.type) {
case KeyPress:
}
else if (keycode == left_code)
{
- shift = 0.25 * (x_max - x_min);
+ shift = PAN * (x_max - x_min);
x_min += shift;
x_max += shift;
}
else if (keycode == right_code)
{
- shift = 0.25 * (x_max - x_min);
+ shift = PAN * (x_max - x_min);
x_min -= shift;
x_max -= shift;
}
else if (keycode == plus_code ||
keycode == equal_code)
{
- shift = 0.25 * (x_max - x_min);
+ shift = ZOOM * (x_max - x_min);
x_min += shift;
x_max -= shift;
}
else if (keycode == minus_code)
{
- shift = 0.5 * (x_max - x_min);
+ shift = (1- 2*ZOOM) * (x_max - x_min);
x_min -= shift;
x_max += shift;
}