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>
This commit is contained in:
Gautham Krishnan 2022-03-12 21:16:59 +05:30 committed by Hossein
parent a40ed687a3
commit 67fcd8f268

View file

@ -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)