Fixing max<min case

This commit is contained in:
GullCode 2023-03-16 12:03:00 +01:00
parent 149cd755ca
commit 7b5f138dfb

View File

@ -247,8 +247,8 @@ namespace ui
auto new_view = nav_.push<FrequencyKeypadView>(field_frequency_max.value()*1000000); auto new_view = nav_.push<FrequencyKeypadView>(field_frequency_max.value()*1000000);
new_view->on_changed = [this, &field](rf::Frequency f) { new_view->on_changed = [this, &field](rf::Frequency f) {
int32_t freq = f / 1000000 ; int32_t freq = f / 1000000 ;
if( freq < steps ) if( freq < 20 )
freq= steps ; freq = 20 ;
field_frequency_max.set_value( freq ); field_frequency_max.set_value( freq );
if( field_frequency_min.value() > ( freq - steps) ) if( field_frequency_min.value() > ( freq - steps) )
field_frequency_min.set_value( freq - steps ); field_frequency_min.set_value( freq - steps );