X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=src%2Fbezier.cpp;h=daa07360079ea818ca7050dc144b0adbbf87eb65;hb=58a6719da2337b3e6e20b581885f170bbe5fc480;hp=99611dc5d5ba99722e1e1fc05ea652abea703320;hpb=0361b11485ec41d2c2ddeb279abf846f777f5363;p=ipdf%2Fcode.git diff --git a/src/bezier.cpp b/src/bezier.cpp index 99611dc..daa0736 100644 --- a/src/bezier.cpp +++ b/src/bezier.cpp @@ -4,6 +4,8 @@ #include #include + + using namespace std; namespace IPDF @@ -54,9 +56,13 @@ static void CubicSolveSegment(vector & roots, const Real & a, const Real & Real l = a*tl*tl*tl + b*tl*tl + c*tl + d; Real u = a*tu*tu*tu + b*tu*tu + c*tu + d; if ((l < 0 && u < 0) || (l > 0 && u > 0)) - return; + { + //Debug("Discarding segment (no roots) l = %f (%f), u = %f (%f)", Double(tl), Double(l), Double(tu), Double(u)); + //return; + } bool negative = (u < l); // lower point > 0, upper point < 0 + //Debug("%ft^3 + %ft^2 + %ft + %f is negative (%f < %f) %d", Double(a),Double(b),Double(c),Double(d),Double(u),Double(l), negative); while (tu - tl > delta) { Real t(tu+tl); @@ -420,3 +426,4 @@ Rect Bezier::SolveBounds() const } } // end namespace +