diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-08-04 10:37:17 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-08-04 20:51:27 +0200 |
commit | 8c48d69f06ddb3cb6c807a1e7db62dddb9778ded (patch) | |
tree | 8b6bf137be41ebe93746c4958ab9106bbf5cc339 /vcl/backendtest | |
parent | c05fbde6c870b7e6bc2f9bf642dc7d76215a496f (diff) |
Use more basegfx deg<->rad functions, instead of direct formulas
Also make the functions constexpr.
Due to slight changes in floating-point arithmetics (90.0 instead of
180.0, M_PI2 instead of M_PI resp.), results might differ in last
digits (usually 17th decimal digit). This has lead to need to tweak
char2dump's PieChartTest unit test.
Change-Id: I20323dd7dab27e4deb408ea4181e390cc05e7cd3
Reviewed-on: https://gerrit.libreoffice.org/58583
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl/backendtest')
-rw-r--r-- | vcl/backendtest/VisualBackendTest.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/backendtest/VisualBackendTest.cxx b/vcl/backendtest/VisualBackendTest.cxx index dc86727eae4c..c8a029474ae1 100644 --- a/vcl/backendtest/VisualBackendTest.cxx +++ b/vcl/backendtest/VisualBackendTest.cxx @@ -417,8 +417,8 @@ public: basegfx::B2DPolygon polygon; for (double a=0.0; a<360.0; a+=0.5) { - double x = std::sin(a*M_PI / 180.0) * (b+1) * 20; - double y = std::cos(a*M_PI / 180.0) * (b+1) * 20; + double x = std::sin(basegfx::deg2rad(a)) * (b+1) * 20; + double y = std::cos(basegfx::deg2rad(a)) * (b+1) * 20; polygon.append(basegfx::B2DPoint(x + 200 + 500 * fTime, y + 200 + 500 * fTime)); } polygon.setClosed(true); |