diff options
author | Tor Andersson <tor@ghostscript.com> | 2009-07-03 00:50:56 +0200 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2009-07-03 00:50:56 +0200 |
commit | 322f289734b045fd2d14de0f8cef89658001be01 (patch) | |
tree | 2b196c3077347d83e37728e26145a4bf38377094 /fitzdraw | |
parent | 3b85981ec662a82642a5453d6f795fecd870aace (diff) | |
download | mupdf-322f289734b045fd2d14de0f8cef89658001be01.tar.xz |
Be less strict when comparing tiny features with epsilon in the path stroking logic.
Diffstat (limited to 'fitzdraw')
-rw-r--r-- | fitzdraw/pathstroke.c | 10 | ||||
-rw-r--r-- | fitzdraw/render.c | 3 |
2 files changed, 8 insertions, 5 deletions
diff --git a/fitzdraw/pathstroke.c b/fitzdraw/pathstroke.c index b597a425..94409789 100644 --- a/fitzdraw/pathstroke.c +++ b/fitzdraw/pathstroke.c @@ -128,9 +128,13 @@ linejoin(struct sctx *s, fz_point a, fz_point b, fz_point c) dy1 = c.y - b.y; if (dx0 * dx0 + dy0 * dy0 < FLT_EPSILON) - return fz_okay; + { + linejoin = BEVEL; + } if (dx1 * dx1 + dy1 * dy1 < FLT_EPSILON) - return fz_okay; + { + linejoin = BEVEL; + } scale = linewidth / sqrt(dx0 * dx0 + dy0 * dy0); dlx0 = dy0 * scale; @@ -342,7 +346,7 @@ strokelineto(struct sctx *s, fz_point cur) float dx = cur.x - s->seg[s->sn-1].x; float dy = cur.y - s->seg[s->sn-1].y; - if (dx * dx + dy * dy < s->flatness * s->flatness * 0.25) + if (dx * dx + dy * dy < FLT_EPSILON) { s->dot = 1; return fz_okay; diff --git a/fitzdraw/render.c b/fitzdraw/render.c index 48c5fd05..cbd5d15f 100644 --- a/fitzdraw/render.c +++ b/fitzdraw/render.c @@ -203,9 +203,8 @@ renderpath(fz_renderer *gc, fz_pathnode *path, fz_matrix ctm) { float lw = path->linewidth; /* Check for hairline */ - if (lw * expansion < 0.1) { + if (lw * expansion < 0.1) lw = 1.0f / expansion; - } if (path->dash) error = fz_dashpath(gc->gel, path, ctm, flatness, lw); else |