X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Ffloatauto.C;h=d575c38e9d846aa2c507145582600c0da821a556;hb=f5725c7e12def18fec49a295dad688652edaa4b3;hp=8e3e63682af1a56e43d3d474bb3f8076d9909041;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/floatauto.C b/cinelerra-5.1/cinelerra/floatauto.C index 8e3e6368..d575c38e 100644 --- a/cinelerra-5.1/cinelerra/floatauto.C +++ b/cinelerra-5.1/cinelerra/floatauto.C @@ -189,9 +189,13 @@ void FloatAuto::toggle_curve_mode() } -void FloatAuto::set_value(float newvalue) +void FloatAuto::set_value(float value) { - this->value=newvalue; + float float_min = ((FloatAutos*)autos)->float_min; + if( value < float_min ) value = float_min; + float float_max = ((FloatAutos*)autos)->float_max; + if( value > float_max ) value = float_max; + this->value = value; this->adjust_curves(); if(previous) ((FloatAuto*)previous)->adjust_curves(); if(next) ((FloatAuto*)next)->adjust_curves(); @@ -356,6 +360,10 @@ inline void FloatAuto::set_ctrl_positions(FloatAuto *prev, FloatAuto* next) void FloatAuto::adjust_to_new_coordinates(int64_t position, float value) // define new position and value in one step, do necessary re-adjustments { + float float_min = ((FloatAutos*)autos)->float_min; + if( value < float_min ) value = float_min; + float float_max = ((FloatAutos*)autos)->float_max; + if( value > float_max ) value = float_max; this->value = value; this->position = position; adjust_ctrl_positions(); @@ -415,6 +423,10 @@ void FloatAuto::copy(int64_t start, int64_t end, FileXML *file, int default_auto void FloatAuto::load(FileXML *file) { value = file->tag.get_property("VALUE", value); + float float_min = ((FloatAutos*)autos)->float_min; + if( value < float_min ) value = float_min; + float float_max = ((FloatAutos*)autos)->float_max; + if( value > float_max ) value = float_max; control_in_value = file->tag.get_property("CONTROL_IN_VALUE", control_in_value); control_out_value = file->tag.get_property("CONTROL_OUT_VALUE", control_out_value); curve_mode = (t_mode)file->tag.get_property("TANGENT_MODE", (int)FREE);