summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorKunal Pawar <hellokunalpawar@gmail.com>2022-02-10 13:20:06 +0530
committerHossein <hossein@libreoffice.org>2022-02-15 21:00:18 +0100
commit49746f40b06eaf1f61bb54454408a06a49d73c5e (patch)
tree3a94fb222ce0bb001f2340372183a1eec36247a4 /vcl
parent2bf59e3b60a0d5c6ebcd4498f5038d6d2e86db62 (diff)
tdf#145759 Use symbolic constants instead of magic numerical constants
1.4142... -> M_SQRT2 0.4142... -> M_SQRT2 - 1 3.1415... -> M_PI 2.7182... -> M_E Change-Id: If5b19aa38d9902b1a4b717f89f18bdf2f73a47cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129745 Tested-by: Hossein <hossein@libreoffice.org> Reviewed-by: Hossein <hossein@libreoffice.org>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/gradient.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/vcl/source/gdi/gradient.cxx b/vcl/source/gdi/gradient.cxx
index cf751abffa97..b4e7db904a29 100644
--- a/vcl/source/gdi/gradient.cxx
+++ b/vcl/source/gdi/gradient.cxx
@@ -21,6 +21,7 @@
#include <vcl/gradient.hxx>
#include <vcl/metaact.hxx>
+#include <cmath>
class Gradient::Impl
{
@@ -250,8 +251,8 @@ void Gradient::GetBoundRect( const tools::Rectangle& rRect, tools::Rectangle& rB
else if( GetStyle() == GradientStyle::Elliptical )
{
// Calculation of radii for ellipse
- aSize.setWidth( static_cast<tools::Long>( 0.5 + static_cast<double>(aSize.Width()) * 1.4142 ) );
- aSize.setHeight( static_cast<tools::Long>( 0.5 + static_cast<double>(aSize.Height()) * 1.4142 ) );
+ aSize.setWidth( static_cast<tools::Long>( 0.5 + static_cast<double>(aSize.Width()) * M_SQRT2 ) );
+ aSize.setHeight( static_cast<tools::Long>( 0.5 + static_cast<double>(aSize.Height()) * M_SQRT2) );
}
// Calculate new centers