mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-02 02:53:44 +00:00
ADL for AlmostEqual* and use math:: instead of base:: (#9634)
* ADL for AlmostEqual* and use math:: instead of base:: Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
committed by
Konstantin Pastbin
parent
82133c5743
commit
30718e106e
@@ -152,7 +152,7 @@ dp::Color GpsTrackRenderer::CalculatePointColor(size_t pointIndex, m2::PointD co
|
||||
endAlpha = kMaxNightAlpha;
|
||||
}
|
||||
|
||||
double const ta = base::Clamp(lengthFromStart / fullLength, 0.0, 1.0);
|
||||
double const ta = math::Clamp(lengthFromStart / fullLength, 0.0, 1.0);
|
||||
double const alpha = startAlpha * (1.0 - ta) + endAlpha * ta;
|
||||
|
||||
if ((end.m_timestamp - start.m_timestamp) > kUnknownDistanceTime)
|
||||
@@ -164,7 +164,7 @@ dp::Color GpsTrackRenderer::CalculatePointColor(size_t pointIndex, m2::PointD co
|
||||
|
||||
double const length = (end.m_point - start.m_point).Length();
|
||||
double const dist = (curPoint - start.m_point).Length();
|
||||
double const td = base::Clamp(dist / length, 0.0, 1.0);
|
||||
double const td = math::Clamp(dist / length, 0.0, 1.0);
|
||||
|
||||
double const speed = std::max(start.m_speedMPS * (1.0 - td) + end.m_speedMPS * td, 0.0);
|
||||
dp::Color const color = GetColorBySpeed(speed);
|
||||
|
||||
Reference in New Issue
Block a user