src/lib/VSDContentCollector.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
New commits: commit 0921f77b64ba08ebfc484362d13bf6f5962fa41e Author: Fridrich Å trba <fridrich.st...@bluewin.ch> Date: Tue Jun 25 10:38:13 2013 +0200 Avoid NANs diff --git a/src/lib/VSDContentCollector.cpp b/src/lib/VSDContentCollector.cpp index b1f83d7..4c53118 100644 --- a/src/lib/VSDContentCollector.cpp +++ b/src/lib/VSDContentCollector.cpp @@ -1352,7 +1352,7 @@ void libvisio::VSDContentCollector::collectNURBSTo(unsigned /* id */, unsigned l NURBS.insert("libwpg:path-action", "L"); double nextX = 0; double nextY = 0; - double denominator = 1E-10; + double denominator = LIBVISIO_EPSILON; for (unsigned p = 0; p < controlPoints.size() && p < weights.size(); p++) { @@ -1399,10 +1399,10 @@ double libvisio::VSDContentCollector::_NURBSBasis(unsigned knot, unsigned degree else return 0; } - if (knotVector.size() > knot+degree && knotVector[knot+degree]-knotVector[knot] > 0) + if (knotVector.size() > knot+degree && fabs(knotVector[knot+degree]-knotVector[knot]) > LIBVISIO_EPSILON) basis = (point-knotVector[knot])/(knotVector[knot+degree]-knotVector[knot]) * _NURBSBasis(knot, degree-1, point, knotVector); - if (knotVector.size() > knot+degree+1 && knotVector[knot+degree+1] - knotVector[knot+1] > 0) + if (knotVector.size() > knot+degree+1 && fabs(knotVector[knot+degree+1] - knotVector[knot+1]) > LIBVISIO_EPSILON) basis += (knotVector[knot+degree+1]-point)/(knotVector[knot+degree+1]-knotVector[knot+1]) * _NURBSBasis(knot+1, degree-1, point, knotVector); return basis;
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits