diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2018-06-10 20:20:18 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2018-08-05 00:31:06 +0000 |
| commit | 850515e890b2bebbac5dcde3b04d3fc0cff52654 (patch) | |
| tree | 29bf5ff744acaedf5bc3ad5d7c831d6a618d2a71 /src/extension/internal/wmf-print.cpp | |
| parent | Allow inkscape handle units and percent in dasharray and dashoffset. Add pref... (diff) | |
| download | inkscape-850515e890b2bebbac5dcde3b04d3fc0cff52654.tar.gz inkscape-850515e890b2bebbac5dcde3b04d3fc0cff52654.zip | |
Revert changes
Diffstat (limited to 'src/extension/internal/wmf-print.cpp')
| -rw-r--r-- | src/extension/internal/wmf-print.cpp | 49 |
1 files changed, 5 insertions, 44 deletions
diff --git a/src/extension/internal/wmf-print.cpp b/src/extension/internal/wmf-print.cpp index dbcfebfc5..613ae3f04 100644 --- a/src/extension/internal/wmf-print.cpp +++ b/src/extension/internal/wmf-print.cpp @@ -40,7 +40,6 @@ #include "helper/geom-curves.h" #include "inkscape-version.h" -#include "inkscape.h" #include "util/units.h" @@ -56,7 +55,6 @@ #include "object/sp-linear-gradient.h" #include "object/sp-root.h" #include "object/sp-item.h" -#include "object/sp-namedview.h" #include "splivarot.h" // pieces for union on shapes #include <2geom/svg-path-parser.h> // to get from SVG text to Geom::Path @@ -604,23 +602,8 @@ int PrintWmf::create_pen(SPStyle const *style, const Geom::Affine &transform) int mark_short=INT_MAX; int mark_long =0; int i; - SPDocument * document = SP_ACTIVE_DOCUMENT; - SPNamedView *nv = sp_document_namedview(document, NULL); - Geom::Rect vbox = document->getViewBox(); - Glib::ustring display_unit = "px"; - if (nv) { - display_unit = nv->display_units->abbr; - } for (i=0;i<n_dash;i++) { - double dashval = 0; - if(style->stroke_dasharray.values[i].unit == SVGLength::NONE) { - dashval = style->stroke_dasharray.values[i].value; - } else if (style->stroke_dasharray.values[i].unit == SVGLength::PERCENT) { - dashval = vbox.width() * style->stroke_dasharray.values[i].value; - } else { - dashval = Inkscape::Util::Quantity::convert(style->stroke_dasharray.values[i].computed, "px", display_unit.c_str()); - } - int mark = (int)dashval; + int mark = style->stroke_dasharray.values[i]; if (mark>mark_long) { mark_long = mark; } if (mark<mark_short) { mark_short = mark; } } @@ -904,25 +887,10 @@ unsigned int PrintWmf::stroke( } tlength = length(tmp_pathpw, 0.1); tmp_pathpw2 = arc_length_parametrization(tmp_pathpw); + // go around the dash array repeatedly until the entire path is consumed (but not beyond). - SPDocument * document = SP_ACTIVE_DOCUMENT; - SPNamedView *nv = sp_document_namedview(document, NULL); - Geom::Rect vbox = document->getViewBox(); - Glib::ustring display_unit = "px"; - if (nv) { - display_unit = nv->display_units->abbr; - } while (slength < tlength) { - SVGLength i1 = style->stroke_dasharray.values[i++]; - double dashval = 0; - if(i1.unit == SVGLength::NONE) { - dashval = i1.value; - } else if (i1.unit == SVGLength::PERCENT) { - dashval = vbox.width() * i1.value; - } else { - dashval = Inkscape::Util::Quantity::convert(i1.computed, "px", display_unit.c_str()); - } - elength = slength + dashval; + elength = slength + style->stroke_dasharray.values[i++]; if (elength > tlength) { elength = tlength; } @@ -932,15 +900,8 @@ unsigned int PrintWmf::stroke( } else { first_frag = fragment; } - SVGLength i2 = style->stroke_dasharray.values[i++]; - if(i2.unit == SVGLength::NONE) { - dashval = i2.value; - } else if (i2.unit == SVGLength::PERCENT) { - dashval = vbox.width() * i2.value; - } else { - dashval = Inkscape::Util::Quantity::convert(i2.computed, "px", display_unit.c_str()); - } - slength += dashval; // the gap + slength = elength; + slength += style->stroke_dasharray.values[i++]; // the gap if (i >= n_dash) { i = 0; } |
