16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 18:39:18 +02:00

virtual slider mouse input mode, minor refactoring, minor bug fixes

This commit is contained in:
tmj-fstate
2018-07-11 17:45:50 +02:00
parent 1056f9bb14
commit 12d70fe320
20 changed files with 330 additions and 269 deletions

View File

@@ -228,6 +228,13 @@ clamp_circular( Type_ Value, Type_ const Range = static_cast<Type_>(360) ) {
return Value;
}
template <typename Type_>
Type_
quantize( Type_ const Value, Type_ const Step ) {
return ( Step * std::round( Value / Step ) );
}
template <typename Type_>
Type_
min_speed( Type_ const Left, Type_ const Right ) {