Codechange: Define sequential operators for ZoomLevel.

This commit is contained in:
frosch
2025-05-03 20:03:39 +02:00
committed by frosch
parent bbfda39ac3
commit 7055ea0aee
10 changed files with 75 additions and 19 deletions

View File

@@ -271,6 +271,12 @@ constexpr bool IsInsideMM(const size_t x, const size_t min, const size_t max) no
constexpr bool IsInsideMM(const ConvertibleThroughBase auto x, const size_t min, const size_t max) noexcept { return IsInsideMM(x.base(), min, max); }
template <typename enum_type, std::enable_if_t<std::is_enum_v<enum_type>, bool> = true>
constexpr bool IsInsideMM(enum_type x, enum_type min, enum_type max) noexcept
{
return IsInsideMM(to_underlying(x), to_underlying(min), to_underlying(max));
}
/**
* Converts a "fract" value 0..255 to "percent" value 0..100
* @param i value to convert, range 0..255