From: joncruz Date: Fri, 23 Mar 2007 06:37:37 +0000 (+0000) Subject: fix floating point comparrisons to not skip values X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b7d0252469423e5e0eb2e5b956c1d9e4bf76e0fc;p=inkscape.git fix floating point comparrisons to not skip values --- diff --git a/src/ege-adjustment-action.cpp b/src/ege-adjustment-action.cpp index 54cde1d1d..c898cfd7e 100644 --- a/src/ege-adjustment-action.cpp +++ b/src/ege-adjustment-action.cpp @@ -228,7 +228,7 @@ static void ege_adjustment_action_init( EgeAdjustmentAction* action ) action->private_data->focusWidget = 0; action->private_data->climbRate = 0.0; action->private_data->digits = 2; - action->private_data->epsilon = 0.01; + action->private_data->epsilon = 0.009; action->private_data->format = g_strdup_printf("%%0.%df%%s%%s", action->private_data->digits); action->private_data->selfId = 0; action->private_data->toolPost = 0; @@ -348,11 +348,11 @@ void ege_adjustment_action_set_property( GObject* obj, guint propId, const GValu /* TODO pass on */ action->private_data->digits = g_value_get_uint( value ); switch ( action->private_data->digits ) { - case 0: action->private_data->epsilon = 1.0; break; - case 1: action->private_data->epsilon = 0.1; break; - case 2: action->private_data->epsilon = 0.01; break; - case 3: action->private_data->epsilon = 0.001; break; - case 4: action->private_data->epsilon = 0.0001; break; + case 0: action->private_data->epsilon = 0.9; break; + case 1: action->private_data->epsilon = 0.09; break; + case 2: action->private_data->epsilon = 0.009; break; + case 3: action->private_data->epsilon = 0.0009; break; + case 4: action->private_data->epsilon = 0.00009; break; } if ( action->private_data->format ) { g_free( action->private_data->format );