summaryrefslogtreecommitdiffstats
path: root/src/2geom
diff options
context:
space:
mode:
authorAlvin Penner <penner@vaxxine.com>2016-04-04 23:05:14 +0000
committerapenner <penner@vaxxine.com>2016-04-04 23:05:14 +0000
commit3ae9b262529ea9e276a1acc2f7ebdb393079c514 (patch)
tree220ea82de3c50eca9693494bdaff058ddfcfb2ba /src/2geom
parentFix node size regression and add ctrlResize property for multiple use. (diff)
downloadinkscape-3ae9b262529ea9e276a1acc2f7ebdb393079c514.tar.gz
inkscape-3ae9b262529ea9e276a1acc2f7ebdb393079c514.zip
avoid higher-order calculations if sbasis is cubic. (Bug 1559721)
Fixed bugs: - https://launchpad.net/bugs/1559721 (bzr r14762)
Diffstat (limited to 'src/2geom')
-rw-r--r--src/2geom/sbasis-to-bezier.cpp2
1 files changed, 2 insertions, 0 deletions
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<Point> & bz, D2<SBasis> 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