diff options
author | pragat-pandya <pragat.pandya@gmail.com> | 2022-02-01 05:59:42 +0530 |
---|---|---|
committer | Hossein <hossein@libreoffice.org> | 2022-02-15 12:17:50 +0100 |
commit | 5f21eaa0e6b689233336cacc949b9a55d545088f (patch) | |
tree | a0f892e0c3a1b738c3e59e934a48b326891714ca /slideshow | |
parent | 22d09d65c0e61cac1fa27af6a04a23e16f97c907 (diff) |
tdf#145759 Using M_PI from cmath instead of magic constants.
Replace the instances of Pi's value as magic number by M_PI
Use M_PI_2 and 2_M_PI instead of calculating these values in code.
Use basegfx functions to convert angle units.
Change-Id: I6cca7cc93704a70ccf3a0571a56a789bc9df51ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129479
Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
Reviewed-by: Hossein <hossein@libreoffice.org>
Tested-by: Jenkins
Diffstat (limited to 'slideshow')
-rw-r--r-- | slideshow/source/engine/opengl/TransitionImpl.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/slideshow/source/engine/opengl/TransitionImpl.cxx b/slideshow/source/engine/opengl/TransitionImpl.cxx index ee0089cbae9e..ba43acddc38c 100644 --- a/slideshow/source/engine/opengl/TransitionImpl.cxx +++ b/slideshow/source/engine/opengl/TransitionImpl.cxx @@ -39,7 +39,7 @@ #include "Operation.hxx" #include "TransitionImpl.hxx" -#include <math.h> +#include <cmath> TransitionScene::TransitionScene(TransitionScene const& rOther) : maLeavingSlidePrimitives(rOther.maLeavingSlidePrimitives) @@ -946,7 +946,7 @@ static T clamp(const T& rIn) std::shared_ptr<OGLTransitionImpl> makeRevolvingCircles( sal_uInt16 nCircles , sal_uInt16 nPointsOnCircles ) { - double dAngle(2*3.1415926/static_cast<double>( nPointsOnCircles )); + double dAngle(2*M_PI/static_cast<double>( nPointsOnCircles )); if(nCircles < 2 || nPointsOnCircles < 4) return makeNByMTileFlip(1,1); float Radius(1.0/static_cast<double>( nCircles )); @@ -963,7 +963,7 @@ std::shared_ptr<OGLTransitionImpl> makeRevolvingCircles( sal_uInt16 nCircles , s float TempAngle(0.0); for(unsigned int Point(0); Point < nPointsOnCircles; ++Point) { - unScaledTexCoords.emplace_back( cos(TempAngle - 3.1415926/2.0) , sin(TempAngle- 3.1415926/2.0) ); + unScaledTexCoords.emplace_back( cos(TempAngle - M_PI_2) , sin(TempAngle- M_PI_2) ); TempAngle += dAngle; } |