diff --git a/src/poly/math.h b/src/poly/math.h index 2bd43619c..0fbbb0702 100644 --- a/src/poly/math.h +++ b/src/poly/math.h @@ -36,7 +36,7 @@ T align(T value, T alignment) { // Rounds the given number up to the next highest multiple. template T round_up(T value, V multiple) { - return value + multiple - 1 - (value - 1) % multiple; + return value ? (value + multiple - 1 - (value - 1) % multiple) : multiple; } inline float saturate(float value) {