diff options
author | Gautham Krishnan <gauthamkrishnanpriya@gmail.com> | 2022-03-12 21:16:59 +0530 |
---|---|---|
committer | Hossein <hossein@libreoffice.org> | 2022-03-18 18:46:00 +0100 |
commit | 67fcd8f268fd04ca2012470af2257b394b77b8fc (patch) | |
tree | 096f6a344f61cdf6f97d76eb78a2f42d707ac095 /basegfx | |
parent | a40ed687a3e2f8e1d17705fcd7d397ba09398cb6 (diff) |
tdf#147906 used std::hypot for Pythagorean addition
Change-Id: I9bf10374af93cd22e429a112937aaa8828126523
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131504
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
Diffstat (limited to 'basegfx')
-rw-r--r-- | basegfx/source/tools/gradienttools.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/basegfx/source/tools/gradienttools.cxx b/basegfx/source/tools/gradienttools.cxx index b4f1f6222f52..c6e716510432 100644 --- a/basegfx/source/tools/gradienttools.cxx +++ b/basegfx/source/tools/gradienttools.cxx @@ -136,7 +136,7 @@ namespace basegfx // add object expansion if(bCircular) { - const double fOriginalDiag(sqrt((fTargetSizeX * fTargetSizeX) + (fTargetSizeY * fTargetSizeY))); + const double fOriginalDiag(std::hypot(fTargetSizeX, fTargetSizeY)); fTargetOffsetX -= (fOriginalDiag - fTargetSizeX) / 2.0; fTargetOffsetY -= (fOriginalDiag - fTargetSizeY) / 2.0; @@ -418,7 +418,7 @@ namespace basegfx return 0.0; } - const double t(1.0 - sqrt(aCoor.getX() * aCoor.getX() + aCoor.getY() * aCoor.getY())); + const double t(1.0 - std::hypot(aCoor.getX(), aCoor.getY())); const sal_uInt32 nSteps(rGradInfo.getSteps()); if(nSteps && t < 1.0) |