mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-21 13:53:37 +00:00
Removed SignedRound and replaced std::round with std::lround where needed
Also see https://clang.llvm.org/extra/clang-tidy/checks/bugprone/incorrect-roundings.html Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
committed by
Konstantin Pastbin
parent
ae349462c6
commit
76d7ef146c
@@ -186,7 +186,7 @@ int GetTileScaleBase(m2::RectD const & r)
|
||||
{
|
||||
double const sz = std::max(r.SizeX(), r.SizeY());
|
||||
ASSERT_GREATER(sz, 0., ("Rect should not be a point:", r));
|
||||
return std::max(1, math::SignedRound(std::log2(mercator::Bounds::kRangeX / sz)));
|
||||
return std::max(1l, std::lround(std::log2(mercator::Bounds::kRangeX / sz)));
|
||||
}
|
||||
|
||||
double GetTileScaleBase(double drawScale)
|
||||
@@ -224,12 +224,12 @@ m2::RectD GetRectForDrawScale(int drawScale, m2::PointD const & center)
|
||||
|
||||
m2::RectD GetRectForDrawScale(double drawScale, m2::PointD const & center, uint32_t tileSize, double visualScale)
|
||||
{
|
||||
return GetRectForDrawScale(math::SignedRound(drawScale), center, tileSize, visualScale);
|
||||
return GetRectForDrawScale(static_cast<int>(std::lround(drawScale)), center, tileSize, visualScale);
|
||||
}
|
||||
|
||||
m2::RectD GetRectForDrawScale(double drawScale, m2::PointD const & center)
|
||||
{
|
||||
return GetRectForDrawScale(math::SignedRound(drawScale), center);
|
||||
return GetRectForDrawScale(static_cast<int>(std::lround(drawScale)), center);
|
||||
}
|
||||
|
||||
uint32_t CalculateTileSize(uint32_t screenWidth, uint32_t screenHeight)
|
||||
|
||||
Reference in New Issue
Block a user