mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-02-03 09:44:26 -05:00
Merge pull request #357 from vsonnier/manual_gain_final_fix
Fix limitless manual gain slider while using mouse wheel
This commit is contained in:
commit
00d3140c0d
@ -164,6 +164,15 @@ void GainCanvas::OnMouseWheelMoved(wxMouseEvent& event) {
|
||||
gInfo = gainInfo[panelHit];
|
||||
|
||||
gInfo->current = gInfo->current + ((movement / 100.0) * ((gInfo->high - gInfo->low) / 100.0));
|
||||
|
||||
//BEGIN Clamp to prevent the meter to escape
|
||||
if (gInfo->current > gInfo->high) {
|
||||
gInfo->current = gInfo->high;
|
||||
}
|
||||
if (gInfo->current < gInfo->low) {
|
||||
gInfo->current = gInfo->low;
|
||||
}
|
||||
|
||||
gInfo->changed = true;
|
||||
|
||||
float levelVal = float(gInfo->current-gInfo->low)/float(gInfo->high-gInfo->low);
|
||||
|
Loading…
Reference in New Issue
Block a user