[SCM] calf/master: + Knob: another workaround for floating point imperfections (like 2.99999 or 3.00001)

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:37:13 UTC 2013


The following commit has been merged in the master branch:
commit cd289170c4988a1115339dfdb850b7f52efe1ebf
Author: kfoltman <kfoltman at 78b06b96-2940-0410-b7fc-879d825d01d8>
Date:   Sat May 10 23:03:15 2008 +0000

    + Knob: another workaround for floating point imperfections (like 2.99999 or 3.00001)
    
    
    git-svn-id: https://calf.svn.sourceforge.net/svnroot/calf/trunk@176 78b06b96-2940-0410-b7fc-879d825d01d8

diff --git a/src/custom_ctl.cpp b/src/custom_ctl.cpp
index 10b14af..2df7357 100644
--- a/src/custom_ctl.cpp
+++ b/src/custom_ctl.cpp
@@ -376,7 +376,7 @@ calf_knob_incr (GtkWidget *widget, int dir_down)
         step = oldstep + 1;
     
     // trying to reduce error cumulation here, by counting from lowest or from highest
-    float value = adj->lower + step * (adj->upper - adj->lower) / nsteps;
+    float value = adj->lower + step * double(adj->upper - adj->lower) / nsteps;
     gtk_range_set_value(GTK_RANGE(widget), value);
     // printf("step %d:%d nsteps %d value %f:%f\n", oldstep, step, nsteps, oldvalue, value);
 }

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list