summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-06-29 09:06:08 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-06-29 12:13:33 +0200
commit2a1725fbc248ccaccbe754b5f62a02f99e077290 (patch)
treeeedf4f6aa4993b62f1a983f0d9e7213b6bb3b610 /tools
parente82527d1fcee6bfb47b4e2a7bc51a7d097f662b0 (diff)
ofz#35504 promote to double earlier
Change-Id: I20906d61f411bba5b37f7248ba9b544afa27a0a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118051 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/source/generic/poly.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index 2575d262a68a..70bafc824404 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -56,8 +56,9 @@
static double ImplGetParameter( const Point& rCenter, const Point& rPt, double fWR, double fHR )
{
- const tools::Long nDX = rPt.X() - rCenter.X();
- double fAngle = atan2( -rPt.Y() + rCenter.Y(), ( ( nDX == 0 ) ? 0.000000001 : nDX ) );
+ 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);
return atan2(fWR*sin(fAngle), fHR*cos(fAngle));
}