[bookmarks] Review fixes.

This commit is contained in:
Daria Volvenkova 2020-03-18 15:53:14 +03:00 committed by mpimenov
parent 30e24efaea
commit 951578290d
2 changed files with 4 additions and 2 deletions

View file

@ -1041,6 +1041,7 @@ void BookmarkManager::UpdateElevationMyPosition(kml::TrackId const & trackId)
{
CHECK_THREAD_CHECKER(m_threadChecker, ());
static_assert(TrackSelectionMark::kInvalidDistance < 0, "");
double myPositionDistance = TrackSelectionMark::kInvalidDistance;
if (m_myPositionMark->HasPosition())
{

View file

@ -117,13 +117,14 @@ bool Track::GetPoint(double distanceInMeters, m2::PointD & pt) const
{
CHECK_GREATER_OR_EQUAL(distanceInMeters, 0.0, (distanceInMeters));
if (fabs(distanceInMeters - m_cachedLengths.front()) < 1e-2)
double const kEpsMeters = 1e-2;
if (base::AlmostEqualAbs(distanceInMeters, m_cachedLengths.front(), kEpsMeters))
{
pt = m_data.m_pointsWithAltitudes.front().GetPoint();
return true;
}
if (fabs(distanceInMeters - m_cachedLengths.back()) < 1e-2)
if (base::AlmostEqualAbs(distanceInMeters, m_cachedLengths.back(), kEpsMeters))
{
pt = m_data.m_pointsWithAltitudes.back().GetPoint();
return true;