diff options
-rw-r--r-- | knob.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -50,8 +50,10 @@ t_symbol *iemgui_key_sym=0; /* taken from g_all_guis.c */ typedef struct _knob /* taken from Frank's modyfied g_all_guis.h */ { t_iemgui x_gui; + int x_prev_h; int x_pos; int x_val; + int x_prev_val; int x_lin0_log1; int x_steady; double x_min; @@ -63,9 +65,12 @@ typedef struct _knob /* taken from Frank's modyfied g_all_guis.h */ static void knob_draw_update(t_knob *x, t_glist *glist) { - if (glist_isvisible(glist)) + if (glist_isvisible(glist) && + (x->x_gui.x_h != x->x_prev_h || x->x_val != x->x_prev_val)) { /* compute dial:*/ + x->x_prev_h = x->x_gui.x_h; + x->x_prev_val = x->x_val; float radius = 0.5*(float)x->x_gui.x_h; double angle = 7.0/36.0 + 34.0/36.0*2.0*M_PI*( (double)x->x_val*0.01/(double)x->x_gui.x_h ); int start = -80; |