diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2014-03-13 00:15:11 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2014-03-13 00:15:11 +0000 |
| commit | 11ed091ae647cd7e56ec5a60359b293b94a3bfec (patch) | |
| tree | 2c1c555a116fc7a59141911d44cfe7b24aee3796 /src/extension/internal/pdfinput/svg-builder.cpp | |
| parent | pdfinput: Do not use an extremely ugly static variable in SvgBuilder (diff) | |
| download | inkscape-11ed091ae647cd7e56ec5a60359b293b94a3bfec.tar.gz inkscape-11ed091ae647cd7e56ec5a60359b293b94a3bfec.zip | |
Render zero-width PDF lines as 1px lines compensated for current transform.
Partially fixes import of some LibreOffice charts. See LP bug #1283537
Fixed bugs:
- https://launchpad.net/bugs/1283537
(bzr r13143)
Diffstat (limited to 'src/extension/internal/pdfinput/svg-builder.cpp')
| -rw-r--r-- | src/extension/internal/pdfinput/svg-builder.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp index 680e6ca94..71e6dc6ae 100644 --- a/src/extension/internal/pdfinput/svg-builder.cpp +++ b/src/extension/internal/pdfinput/svg-builder.cpp @@ -298,14 +298,6 @@ static gchar *svgInterpretPath(GfxPath *path) { * Uses the given SPCSSAttr for storing the style properties */ void SvgBuilder::_setStrokeStyle(SPCSSAttr *css, GfxState *state) { - - // Check line width - if ( state->getLineWidth() <= 0.0 ) { - // Ignore stroke - sp_repr_css_set_property(css, "stroke", "none"); - return; - } - // Stroke color/pattern if ( state->getStrokeColorSpace()->getMode() == csPattern ) { gchar *urltext = _createPattern(state->getStrokePattern(), state, true); @@ -326,7 +318,14 @@ void SvgBuilder::_setStrokeStyle(SPCSSAttr *css, GfxState *state) { // Line width Inkscape::CSSOStringStream os_width; - os_width << state->getLineWidth(); + double lw = state->getLineWidth(); + if (lw > 0.0) { + os_width << lw; + } else { + // emit a stroke which is 1px in toplevel user units + double pxw = Inkscape::Util::Quantity::convert(1.0, "pt", "px"); + os_width << 1.0 / state->transformWidth(pxw); + } sp_repr_css_set_property(css, "stroke-width", os_width.str().c_str()); // Line cap |
