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:
Alexander Borsuk
2025-07-06 01:25:08 +02:00
committed by Konstantin Pastbin
parent ae349462c6
commit 76d7ef146c
22 changed files with 67 additions and 60 deletions

View File

@@ -218,18 +218,18 @@ void ScreenBase::SetAngle(double angle)
UpdateDependentParameters();
}
int ScreenBase::GetWidth() const { return math::SignedRound(m_PixelRect.SizeX()); }
int ScreenBase::GetWidth() const { return std::lround(m_PixelRect.SizeX()); }
int ScreenBase::GetHeight() const { return math::SignedRound(m_PixelRect.SizeY()); }
int ScreenBase::GetHeight() const { return std::lround(m_PixelRect.SizeY()); }
ScreenBase::MatrixT ScreenBase::CalcTransform(m2::PointD const & oldPt1,
m2::PointD const & oldPt2,
m2::PointD const & newPt1,
m2::PointD const & newPt2,
m2::PointD const & newPt2,
bool allowRotate,
bool allowScale)
{
double const s = allowScale ? newPt1.Length(newPt2) / oldPt1.Length(oldPt2) : 1.0;
double const a = allowRotate ? ang::AngleTo(newPt1, newPt2) - ang::AngleTo(oldPt1, oldPt2) : 0.0;