mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-26 15:53:36 +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
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user