From 3ae9b262529ea9e276a1acc2f7ebdb393079c514 Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Mon, 4 Apr 2016 19:05:14 -0400 Subject: avoid higher-order calculations if sbasis is cubic. (Bug 1559721) Fixed bugs: - https://launchpad.net/bugs/1559721 (bzr r14762) --- src/2geom/sbasis-to-bezier.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/2geom') diff --git a/src/2geom/sbasis-to-bezier.cpp b/src/2geom/sbasis-to-bezier.cpp index 8a18cfd4a..64c07f35e 100644 --- a/src/2geom/sbasis-to-bezier.cpp +++ b/src/2geom/sbasis-to-bezier.cpp @@ -197,6 +197,8 @@ void sbasis_to_cubic_bezier (std::vector & bz, D2 const& sb) } sbasis_to_bezier(bz, sb, 4); // zeroth-order estimate + if ((sb[X].size() < 3) && (sb[Y].size() < 3)) + return; // cubic bezier estimate is exact Geom::ConvexHull bezhull(bz); // calculate first derivatives of x and y wrt t -- cgit v1.2.3