lxgui
Loading...
Searching...
No Matches
utils_maths.hpp
1#ifndef LXGUI_UTILS_MATHS_HPP
2#define LXGUI_UTILS_MATHS_HPP
3
4#include "lxgui/lxgui.hpp"
5#include "lxgui/utils.hpp"
6
7namespace lxgui::utils {
8
10enum class rounding_method {
12 nearest,
16 up,
18 down
19};
20
28float round(float value, float unit, rounding_method method);
29
30} // namespace lxgui::utils
31
32#endif
float round(float value, float unit, rounding_method method)
Round a floating point value to a specific unit and using a specific rounding method.
rounding_method
Rounding method for points to pixels conversions.
@ up
Equivalent to ceil()
@ down
Equivalent to floor()
@ nearest
Equivalent to round()
@ nearest_not_zero
Equivalent to round() but only returns 0 if input is exactly 0.