Clamp, scroll, scrollspeed, sliders
Reduced clamp duplication Fixed scrolling speed issue Modified scrollspeed slider to use a range Fixed scrollspeed, volume, and sound sliders not showing current setting.
This commit is contained in:
committed by
Chris Forbes
parent
ab431fe9ee
commit
c85503811c
@@ -67,15 +67,5 @@ namespace OpenRA
|
||||
Log.Write("perf", text, x, dt * 1000, Game.LocalTick);
|
||||
});
|
||||
}
|
||||
|
||||
public static T Clamp<T>(this T val, T min, T max) where T : IComparable<T>
|
||||
{
|
||||
if (val.CompareTo(min) < 0)
|
||||
return min;
|
||||
else if (val.CompareTo(max) > 0)
|
||||
return max;
|
||||
else
|
||||
return val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user