]> git.cworth.org Git - acre/blobdiff - acre-x.c
Add another dataset style: ACRE_STYLE_BARS
[acre] / acre-x.c
index f0fac370a5d9bb45e414c7834a6e5e9087805624..c375c36efddee95a1d7afd4e74262a3d740f4cbd 100644 (file)
--- a/acre-x.c
+++ b/acre-x.c
@@ -126,6 +126,7 @@ handle_events(Display *dpy, Window window, Visual *visual,
                XNextEvent (dpy, &xev);
                 switch (xev.type) {
                 case KeyPress:
+                       need_redraw = true;
                        keycode = xev.xkey.keycode;
                        if (keycode == quit_code ||
                            keycode == escape_code)
@@ -153,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;
                        }
@@ -161,7 +162,10 @@ handle_events(Display *dpy, Window window, Visual *visual,
                        {
                                acre_get_x_axis_data_range (acre, &x_min, &x_max);
                        }
-                       need_redraw = 1;
+                       else
+                       {
+                               need_redraw = false;
+                       }
                        break;
                 case ConfigureNotify:
                         width = xev.xconfigure.width;