diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-11-14 13:52:27 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-11-14 15:12:11 +0000 |
commit | c0e1dfdab1a13def046e94d771f8a821ba2a10d9 (patch) | |
tree | cbbcecc1d8cf2c339b9decc3a43a6cdd690ac005 /source/fitz | |
parent | 7e3600ef2f8fde2ff390be4b15d232e9f8643a48 (diff) | |
download | mupdf-c0e1dfdab1a13def046e94d771f8a821ba2a10d9.tar.xz |
Workaround 0 line-width strokes in svg output.
A line width of 0 has special meaning in PDF files. SVGs don't
understand it, so modify our SVG output device to send all line
widths smaller than 1 as being 1.
Diffstat (limited to 'source/fitz')
-rw-r--r-- | source/fitz/svg-device.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/fitz/svg-device.c b/source/fitz/svg-device.c index 7397d059..8a83c97b 100644 --- a/source/fitz/svg-device.c +++ b/source/fitz/svg-device.c @@ -167,8 +167,11 @@ svg_dev_stroke_state(fz_context *ctx, svg_device *sdev, const fz_stroke_state *s exp = fz_matrix_expansion(ctm); if (exp == 0) exp = 1; + exp = stroke_state->linewidth/exp; + if (exp < 1) + exp = 1; - fz_printf(ctx, out, " stroke-width=\"%g\"", stroke_state->linewidth/exp); + fz_printf(ctx, out, " stroke-width=\"%g\"", exp); fz_printf(ctx, out, " stroke-linecap=\"%s\"", (stroke_state->start_cap == FZ_LINECAP_SQUARE ? "square" : (stroke_state->start_cap == FZ_LINECAP_ROUND ? "round" : "butt"))); |