Skip to content

Commit

Permalink
[ranges] Rename default positive ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Nov 2, 2024
1 parent 4540014 commit e9a0f84
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions include/halp/controls.sliders.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <halp/static_string.hpp>
#include <halp/value_types.hpp>

#include <limits>
#include <string_view>
#include <type_traits>

Expand All @@ -24,6 +25,13 @@ template <typename T>
inline constexpr auto default_irange = irange{0, 127, 64};

// Range still constrained as many ui widgets bail out past some ~2^24 value
template <typename T = long double>
inline constexpr auto positive_range_min
= range{0., std::numeric_limits<int>::max() / 256., 0.};
template <typename T = long double>
inline constexpr auto positive_range_max
= range{0., std::numeric_limits<int>::max() / 256., 1.};

template <typename T = long double>
inline constexpr auto free_range_min = range{
std::numeric_limits<int>::lowest() / 256., std::numeric_limits<int>::max() / 256.,
Expand All @@ -33,13 +41,6 @@ inline constexpr auto free_range_max = range{
std::numeric_limits<int>::lowest() / 256., std::numeric_limits<int>::max() / 256.,
1.};

template <typename T = long double>
inline constexpr auto free_positive_range_min
= range{0., std::numeric_limits<int>::max() / 256., 0.};
template <typename T = long double>
inline constexpr auto free_positive_range_max
= range{0., std::numeric_limits<int>::max() / 256., 1.};

template <typename T>
struct init_range_t
{
Expand Down

0 comments on commit e9a0f84

Please sign in to comment.