Merge pull request #357 from vsonnier/manual_gain_final_fix

Fix limitless manual gain slider while using mouse wheel
This commit is contained in:
Charles J. Cliffe 2016-06-02 17:34:34 -04:00
commit 00d3140c0d

View File

@ -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);