summaryrefslogtreecommitdiff
path: root/basegfx
diff options
context:
space:
mode:
authorHakimOttey <hakimotteybusiness@gmail.com>2024-05-20 15:25:20 -0400
committerMike Kaganski <mike.kaganski@collabora.com>2024-06-13 15:58:40 +0200
commitc0adf5a90a51f500d633aad9786015f187531d31 (patch)
tree2358547faf067a26f0440af2b072c9a33f8eb07d /basegfx
parentbd2ffb6f33e549483b41f6235ba64fa735205d38 (diff)
Related: tdf#147906 Rename fQuadDist to pointDistance
after commit 9dad7c0f1095e85ad40ad874215f1051137b0347 Author: HakimOttey <hakimotteybusiness@gmail.com> Date: Mon May 6 12:44:29 2024 -0400 tdf#147906 implement hypot function for s1 x s1 + s2 x s2 statements where the names were kept, but became confusing. Change-Id: If2bfa4b5fc1dd04bb4f1026b6f89e3c97a43caf8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167850 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'basegfx')
-rw-r--r--basegfx/source/curve/b2dcubicbezier.cxx26
1 files changed, 14 insertions, 12 deletions
diff --git a/basegfx/source/curve/b2dcubicbezier.cxx b/basegfx/source/curve/b2dcubicbezier.cxx
index 31801db53559..788c63b828c1 100644
--- a/basegfx/source/curve/b2dcubicbezier.cxx
+++ b/basegfx/source/curve/b2dcubicbezier.cxx
@@ -22,7 +22,9 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/numeric/ftools.hxx>
+
#include <osl/diagnose.h>
+
#include <cmath>
#include <limits>
@@ -644,17 +646,17 @@ namespace basegfx
// now look for the closest point
const sal_uInt32 nPointCount(aInitialPolygon.count());
B2DVector aVector(rTestPoint - aInitialPolygon.getB2DPoint(0));
- double fQuadDist(std::hypot(aVector.getX(), aVector.getY()));
- double fNewQuadDist;
+ double pointDistance(std::hypot(aVector.getX(), aVector.getY()));
+ double newPointDistance;
sal_uInt32 nSmallestIndex(0);
for(sal_uInt32 a(1); a < nPointCount; a++)
{
aVector = B2DVector(rTestPoint - aInitialPolygon.getB2DPoint(a));
- fNewQuadDist = std::hypot(aVector.getX(), aVector.getY());
- if(fNewQuadDist < fQuadDist)
+ newPointDistance = std::hypot(aVector.getX(), aVector.getY());
+ if(newPointDistance < pointDistance)
{
- fQuadDist = fNewQuadDist;
+ pointDistance = newPointDistance;
nSmallestIndex = a;
}
}
@@ -678,11 +680,11 @@ namespace basegfx
aVector = B2DVector(rTestPoint - interpolatePoint(fPosLeft));
}
- fNewQuadDist = std::hypot(aVector.getX(), aVector.getY());
+ newPointDistance = std::hypot(aVector.getX(), aVector.getY());
- if(fTools::less(fNewQuadDist, fQuadDist))
+ if(fTools::less(newPointDistance, pointDistance))
{
- fQuadDist = fNewQuadDist;
+ pointDistance = newPointDistance;
fPosition = fPosLeft;
}
else
@@ -700,11 +702,11 @@ namespace basegfx
aVector = B2DVector(rTestPoint - interpolatePoint(fPosRight));
}
- fNewQuadDist = std::hypot(aVector.getX(), aVector.getY());
+ newPointDistance = std::hypot(aVector.getX(), aVector.getY());
- if(fTools::less(fNewQuadDist, fQuadDist))
+ if(fTools::less(newPointDistance, pointDistance))
{
- fQuadDist = fNewQuadDist;
+ pointDistance = newPointDistance;
fPosition = fPosRight;
}
else
@@ -725,7 +727,7 @@ namespace basegfx
}
rCut = fPosition;
- return fQuadDist;
+ return pointDistance;
}
void B2DCubicBezier::split(double t, B2DCubicBezier* pBezierA, B2DCubicBezier* pBezierB) const