diff options
| author | Alvin Penner <penner@vaxxine.com> | 2015-08-30 11:37:24 +0000 |
|---|---|---|
| committer | apenner <penner@vaxxine.com> | 2015-08-30 11:37:24 +0000 |
| commit | 952f240eb043f626eab87dcf1348d778d96ca363 (patch) | |
| tree | 608678fed7af4d023da98490c2f493b94233a48e /src | |
| parent | Ensure strncpy'd strings are null terminated (diff) | |
| download | inkscape-952f240eb043f626eab87dcf1348d778d96ca363.tar.gz inkscape-952f240eb043f626eab87dcf1348d778d96ca363.zip | |
lpe-powerstroke. validity check on data. (Bug 1487424)
Fixed bugs:
- https://launchpad.net/bugs/1487424
(bzr r14333)
Diffstat (limited to 'src')
| -rw-r--r-- | src/live_effects/lpe-powerstroke.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/live_effects/lpe-powerstroke.cpp b/src/live_effects/lpe-powerstroke.cpp index f90d67d4e..03102a84a 100644 --- a/src/live_effects/lpe-powerstroke.cpp +++ b/src/live_effects/lpe-powerstroke.cpp @@ -102,12 +102,15 @@ static Circle touching_circle( D2<SBasis> const &curve, double t, double tol=0.0 { //Piecewise<SBasis> k = curvature(curve, tol); D2<SBasis> dM=derivative(curve); - if ( are_near(L2sq(dM(t)),0.) ) { + if ( are_near(L2sq(dM(t)),0.) && (dM[0].size() > 1) && (dM[1].size() > 1) ) { dM=derivative(dM); } - if ( are_near(L2sq(dM(t)),0.) ) { // try second time + if ( are_near(L2sq(dM(t)),0.) && (dM[0].size() > 1) && (dM[1].size() > 1) ) { // try second time dM=derivative(dM); } + if ( are_near(L2sq(dM(t)),0.) && (dM[0].size() > 1) && (dM[1].size() > 1) ) { // admit defeat + return Geom::Circle(Geom::Point(0., 0.), 0.); + } Piecewise<D2<SBasis> > unitv = unitVector(dM,tol); Piecewise<SBasis> dMlength = dot(Piecewise<D2<SBasis> >(dM),unitv); Piecewise<SBasis> k = cross(derivative(unitv),unitv); |
