tools/source/generic/poly.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit 6419ecb40a025f1b4f7df5d059bfca3579dab4d7 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Wed Sep 15 12:34:12 2021 +0200 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Wed Sep 15 16:54:19 2021 +0200 No need to check if nDX is 0 for atan2 We rely on IEEE floating-point arithmetic anyway, and then even both arguments equal to 0 do not result in an error. Even if it was different, it would be better to check id both nDX and nDY are 0, and return 0 early. It was so ever since "MWS_SRX644: migrate branch mws_srx644 -> HEAD" commit fd2cf3dc7cd9c73070fa4d70c8ca99c9fc1ce135. Change-Id: I5b8e2a359374dd1500b149d74eba4c0b0e5cd8d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122115 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index 70bafc824404..ab33eb61021b 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -58,7 +58,7 @@ static double ImplGetParameter( const Point& rCenter, const Point& rPt, double f { const double nDX = static_cast<double>(rPt.X()) - rCenter.X(); const double nDY = static_cast<double>(rCenter.Y()) - rPt.Y(); - double fAngle = atan2(nDY, (nDX == 0) ? 0.000000001 : nDX); + double fAngle = atan2(nDY, nDX); return atan2(fWR*sin(fAngle), fHR*cos(fAngle)); }