diff --git a/splash/Splash.cc b/splash/Splash.cc index 5bc7767..04567ed 100644 --- a/splash/Splash.cc +++ b/splash/Splash.cc @@ -5914,7 +5914,7 @@ SplashPath *Splash::makeStrokePath(SplashPath *path, SplashCoord w, SplashPath *pathIn, *dashPath, *pathOut; SplashCoord d, dx, dy, wdx, wdy, dxNext, dyNext, wdxNext, wdyNext; SplashCoord crossprod, dotprod, miter, m; - GBool first, last, closed; + GBool first, last, closed, hasangle; int subpathStart0, subpathStart1, seg, i0, i1, j0, j1, k0, k1; int left0, left1, left2, right0, right1, right2, join0, join1, join2; int leftFirst, rightFirst, firstPt; @@ -6142,6 +6142,7 @@ SplashPath *pathIn, *dashPath, *pathOut; // compute the join parameters crossprod = dx * dyNext - dy * dxNext; dotprod = -(dx * dxNext + dy * dyNext); + hasangle = crossprod != 0 || dx * dxNext < 0 || dy * dyNext < 0; if (dotprod > 0.9999) { // avoid a divide-by-zero -- set miter to something arbitrary // such that sqrt(miter) will exceed miterLimit (and m is never @@ -6161,7 +6162,7 @@ SplashPath *pathIn, *dashPath, *pathOut; } // round join - if (state->lineJoin == splashLineJoinRound) { + if (hasangle && state->lineJoin == splashLineJoinRound) { pathOut->moveTo(pathIn->pts[j0].x + (SplashCoord)0.5 * w, pathIn->pts[j0].y); pathOut->curveTo(pathIn->pts[j0].x + (SplashCoord)0.5 * w, @@ -6189,7 +6190,7 @@ SplashPath *pathIn, *dashPath, *pathOut; pathIn->pts[j0].x + (SplashCoord)0.5 * w, pathIn->pts[j0].y); - } else { + } else if (hasangle) { pathOut->moveTo(pathIn->pts[j0].x, pathIn->pts[j0].y); // angle < 180