Fix limitless manual gain slider

This commit is contained in:
vsonnier 2016-06-01 20:00:21 +02:00
parent df4fb649f3
commit c236a2e1cb

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