[poppler] splash/Splash.cc
Albert Astals Cid
aacid at kemper.freedesktop.org
Mon May 16 23:00:57 UTC 2016
splash/Splash.cc | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
New commits:
commit 202e18e2d30242d642293fc9f57350a045d146aa
Author: Albert Astals Cid <aacid at kde.org>
Date: Tue May 17 01:00:37 2016 +0200
Improve rendering of some dotted lines
Bug #84693
diff --git a/splash/Splash.cc b/splash/Splash.cc
index 5bc7767..5acbe8e 100644
--- a/splash/Splash.cc
+++ b/splash/Splash.cc
@@ -13,7 +13,7 @@
//
// Copyright (C) 2005-2015 Albert Astals Cid <aacid at kde.org>
// Copyright (C) 2005 Marco Pesenti Gritti <mpg at redhat.com>
-// Copyright (C) 2010-2015 Thomas Freitag <Thomas.Freitag at alfa.de>
+// Copyright (C) 2010-2016 Thomas Freitag <Thomas.Freitag at alfa.de>
// Copyright (C) 2010 Christian Feuersänger <cfeuersaenger at googlemail.com>
// Copyright (C) 2011-2013, 2015 William Bader <williambader at hotmail.com>
// Copyright (C) 2012 Markus Trippelsdorf <markus at trippelsdorf.de>
@@ -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
More information about the poppler
mailing list