diff options
| author | mathog <> | 2017-02-17 17:27:30 +0000 |
|---|---|---|
| committer | mathog <> | 2017-02-17 17:27:30 +0000 |
| commit | ec50243a7a1731517e2fac792d7feb67e87e8889 (patch) | |
| tree | 01d4f9aa5536f1c354ca7bd46b1b01013370772d /src/extension/internal/wmf-print.cpp | |
| parent | resolve bug 1665421 (diff) | |
| download | inkscape-ec50243a7a1731517e2fac792d7feb67e87e8889.tar.gz inkscape-ec50243a7a1731517e2fac792d7feb67e87e8889.zip | |
improve dot dash support in wmf export
(bzr r15526)
Diffstat (limited to 'src/extension/internal/wmf-print.cpp')
| -rw-r--r-- | src/extension/internal/wmf-print.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/extension/internal/wmf-print.cpp b/src/extension/internal/wmf-print.cpp index 3d913bf1e..6dd9d895e 100644 --- a/src/extension/internal/wmf-print.cpp +++ b/src/extension/internal/wmf-print.cpp @@ -598,7 +598,28 @@ int PrintWmf::create_pen(SPStyle const *style, const Geom::Affine &transform) if (!style->stroke_dasharray.values.empty()) { if (!FixPPTDashLine) { // if this is set code elsewhere will break dots/dashes into many smaller lines. - penstyle = U_PS_DASH;// userstyle not supported apparently, for now map all Inkscape dot/dash to just dash + int n_dash = style->stroke_dasharray.values.size(); + /* options are dash, dot, dashdot and dashdotdot. Try to pick the closest one. */ + int mark_short=INT_MAX; + int mark_long =0; + int i; + for (i=0;i<n_dash;i++) { + int mark = style->stroke_dasharray.values[i]; + if (mark>mark_long) { mark_long = mark; } + if (mark<mark_short) { mark_short = mark; } + } + if(mark_long == mark_short){ // only one mark size + penstyle = U_PS_DOT; + } + else if (n_dash==2) { + penstyle = U_PS_DASH; + } + else if (n_dash==4) { + penstyle = U_PS_DASHDOT; + } + else { + penstyle = U_PS_DASHDOTDOT; + } } } |
