mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-22 22:23:44 +00:00
[core] Use constexpr when possible
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
This commit is contained in:
@@ -26,9 +26,9 @@ namespace
|
||||
{
|
||||
std::string const kTrackSelectedSymbolName = "track_marker_selected";
|
||||
df::ColorConstant const kSelectionColor = "Selection";
|
||||
float const kLeftSide = 1.0f;
|
||||
float const kCenter = 0.0f;
|
||||
float const kRightSide = -1.0f;
|
||||
float constexpr kLeftSide = 1.0f;
|
||||
float constexpr kCenter = 0.0f;
|
||||
float constexpr kRightSide = -1.0f;
|
||||
|
||||
struct MarkerVertex
|
||||
{
|
||||
@@ -91,7 +91,7 @@ dp::BindingInfo GetSelectionLineVertexBindingInfo()
|
||||
|
||||
float SideByNormal(glsl::vec2 const & normal, bool isLeft)
|
||||
{
|
||||
float const kEps = 1e-5;
|
||||
float constexpr kEps = 1e-5;
|
||||
float const side = isLeft ? kLeftSide : kRightSide;
|
||||
return glsl::length(normal) < kEps ? kCenter : side;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user