mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-25 23:30:40 -04:00
Two minor patches - freqman file processing & NumberField "can_loop" option (#981)
-Enhanced frequency file reading: Correctly read freq files that contain a mix of SINGLE and RANGE or HAM_RADIO types (strstr in file processing was ignoring EOL and was therefore finding the f= on the next line). Also changed to simply ignore blank or unrecognized lines versus adding them as SIMPLE entries to freq table. This allow comments and white line in freqman files. -Fixed "can_loop" option in NumberField: When NumberField range.first was non-zero, and can_loop was true, turning the encoder dial in the downward direction did not result in numbers looping back to range.second as was expected. This fix allows looping in downward direction in the case where range.first is non-zero.
This commit is contained in:
parent
1e4ea753ba
commit
730e7ad72b
2 changed files with 4 additions and 5 deletions
|
@ -1700,7 +1700,7 @@ int32_t NumberField::value() const {
|
|||
|
||||
void NumberField::set_value(int32_t new_value, bool trigger_change) {
|
||||
if (can_loop) {
|
||||
if (new_value >= 0)
|
||||
if (new_value >= range.first)
|
||||
new_value = new_value % (range.second + 1);
|
||||
else
|
||||
new_value = range.second + new_value + 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue