diff options
author | Glenn Kennard <glenn.kennard@gmail.com> | 2008-04-19 12:01:33 +0200 |
---|---|---|
committer | Glenn Kennard <glenn.kennard@gmail.com> | 2008-04-19 12:01:33 +0200 |
commit | 94a50be10b6a76175d1107c2a92c73f3490d1445 (patch) | |
tree | 695bd47bd1e7878d9a7933488dc183cc40140dbd /raster/render.c | |
parent | 8dfe55b5c063236a80955c38a4f836df39a0a31c (diff) | |
download | mupdf-94a50be10b6a76175d1107c2a92c73f3490d1445.tar.xz |
Support hairlines (zero-width lines)
Diffstat (limited to 'raster/render.c')
-rw-r--r-- | raster/render.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/raster/render.c b/raster/render.c index 4e010179..596bedab 100644 --- a/raster/render.c +++ b/raster/render.c @@ -187,8 +187,9 @@ renderpath(fz_renderer *gc, fz_pathnode *path, fz_matrix ctm) float flatness; fz_irect gbox; fz_irect clip; + float expansion = fz_matrixexpansion(ctm); - flatness = 0.3 / fz_matrixexpansion(ctm); + flatness = 0.3 / expansion; if (flatness < 0.1) flatness = 0.1; @@ -196,10 +197,15 @@ renderpath(fz_renderer *gc, fz_pathnode *path, fz_matrix ctm) if (path->paint == FZ_STROKE) { + float lw = path->linewidth; + // Check for hairline + if (lw * expansion < 0.2) { + lw = 1.0f / expansion; + } if (path->dash) - error = fz_dashpath(gc->gel, path, ctm, flatness); + error = fz_dashpath(gc->gel, path, ctm, flatness, lw); else - error = fz_strokepath(gc->gel, path, ctm, flatness); + error = fz_strokepath(gc->gel, path, ctm, flatness, lw); } else error = fz_fillpath(gc->gel, path, ctm, flatness); |