mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 02:49:19 +02:00
fix: keep quantize() in its own value type
The S5276 change cast the result of the generic quantize<Type_>() to unsigned int, which truncated float/double callers (shadow angle slider, editor rotation snapping, AI speed control steps) and broke negative values.
This commit is contained in:
@@ -314,7 +314,7 @@ template <typename T> T clamp_power_of_two(T Value, T const Min = T(1), T const
|
|||||||
template <typename Type_> Type_ quantize(Type_ const Value, Type_ const Step)
|
template <typename Type_> Type_ quantize(Type_ const Value, Type_ const Step)
|
||||||
{
|
{
|
||||||
|
|
||||||
return static_cast<unsigned int>(Step * std::round(Value / Step));
|
return static_cast<Type_>(Step * std::round(Value / Step));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T> T min_speed(T const Left, T const Right)
|
template <typename T> T min_speed(T const Left, T const Right)
|
||||||
|
|||||||
Reference in New Issue
Block a user