Skip to content

Commit

Permalink
Code style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kpr0th committed Dec 26, 2023
1 parent b1f3206 commit fc237cc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ui/src/virtualconsole/vccuelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -817,12 +817,16 @@ void VCCueList::slotCurrentStepChanged(int stepNumber)

float stepVal;
int stepsCount = m_tree->topLevelItemCount();
if (stepsCount < 256) {
if (stepsCount < 256)
{
stepVal = 256.0 / (float)stepsCount; //divide up the full 0..255 range
stepVal = (float)qFloor((stepVal * 100000) + 0.5) / 100000; //round to 5 decimals to fix corner cases
} else {
}
else
{
stepVal = 1.0;
}

// value->step# truncates down in slotSideFaderValueChanged; so use ceiling for step#->value
float slValue = stepVal * (float)stepNumber;
if (slValue > 255)
Expand Down

0 comments on commit fc237cc

Please sign in to comment.