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 | |
| 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')
| -rw-r--r-- | src/extension/internal/cairo-render-context.cpp | 28 | ||||
| -rw-r--r-- | src/extension/internal/emf-inout.cpp | 58 | ||||
| -rw-r--r-- | src/extension/internal/emf-print.cpp | 53 | ||||
| -rw-r--r-- | src/extension/internal/javafx-out.cpp | 31 | ||||
| -rw-r--r-- | src/extension/internal/latex-pstricks.cpp | 10 | ||||
| -rw-r--r-- | src/extension/internal/wmf-inout.cpp | 33 | ||||
| -rw-r--r-- | src/extension/internal/wmf-print.cpp | 49 |
7 files changed, 40 insertions, 222 deletions
diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp index 6d2267fde..da0797600 100644 --- a/src/extension/internal/cairo-render-context.cpp +++ b/src/extension/internal/cairo-render-context.cpp @@ -48,8 +48,7 @@ #include "object/sp-pattern.h" #include "object/sp-mask.h" #include "object/sp-clippath.h" -#include "object/sp-namedview.h" -#include "inkscape.h" + #include "util/units.h" #ifdef WIN32 #include "libnrtype/FontFactory.h" // USE_PANGO_WIN32 @@ -1436,31 +1435,10 @@ CairoRenderContext::_setStrokeStyle(SPStyle const *style, Geom::OptRect const &p { size_t ndashes = style->stroke_dasharray.values.size(); double* dashes =(double*)malloc(ndashes*sizeof(double)); - 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( unsigned i = 0; i < ndashes; ++i ) { - if(style->stroke_dasharray.values[i].unit == SVGLength::NONE) { - dashes[i] = style->stroke_dasharray.values[i].value; - } else if (style->stroke_dasharray.values[i].unit == SVGLength::PERCENT) { - dashes[i] = vbox.width() * style->stroke_dasharray.values[i].value; - } else { - dashes[i] = Inkscape::Util::Quantity::convert(style->stroke_dasharray.values[i].computed, "px", display_unit.c_str()); - } - } - double dash_offset = 0; - if (style->stroke_dashoffset.unit == SVGLength::NONE) { - dash_offset = style->stroke_dashoffset.value; - } else if (style->stroke_dashoffset.unit == SVGLength::PERCENT) { - dash_offset = vbox.width() * style->stroke_dashoffset.value ; - } else { - dash_offset = Inkscape::Util::Quantity::convert(style->stroke_dashoffset.computed, "px", display_unit.c_str()); + dashes[i] = style->stroke_dasharray.values[i]; } - cairo_set_dash(_cr, dashes, ndashes, dash_offset); + cairo_set_dash(_cr, dashes, ndashes, style->stroke_dashoffset.value); free(dashes); } else { cairo_set_dash(_cr, nullptr, 0, 0.0); // disable dashing diff --git a/src/extension/internal/emf-inout.cpp b/src/extension/internal/emf-inout.cpp index 79645466f..d0556e467 100644 --- a/src/extension/internal/emf-inout.cpp +++ b/src/extension/internal/emf-inout.cpp @@ -35,7 +35,6 @@ #include "document.h" #include "object/sp-root.h" #include "object/sp-path.h" -#include "object/sp-namedview.h" #include "print.h" #include "extension/system.h" #include "extension/print.h" @@ -46,11 +45,9 @@ #include "display/drawing-item.h" #include "clear-n_.h" #include "svg/svg.h" -#include "svg/svg-length.h" #include "util/units.h" // even though it is included indirectly by emf-inout.h #include "inkscape.h" // even though it is included indirectly by emf-inout.h - #include "emf-print.h" #include "emf-inout.h" @@ -984,24 +981,10 @@ Emf::output_style(PEMF_CALLBACK_DATA d, int iType) !d->dc[d->level].style.stroke_dasharray.values.empty() ) { tmp_style << "stroke-dasharray:"; - 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 (unsigned i=0; i<d->dc[d->level].style.stroke_dasharray.values.size(); i++) { if (i) tmp_style << ","; - if(d->dc[d->level].style.stroke_dasharray.values[i].unit == SVGLength::NONE) { - tmp_style << d->dc[d->level].style.stroke_dasharray.values[i].value; - } else if (d->dc[d->level].style.stroke_dasharray.values[i].unit == SVGLength::PERCENT) { - tmp_style << vbox.width() * d->dc[d->level].style.stroke_dasharray.values[i].value; - } else { - tmp_style << Inkscape::Util::Quantity::convert(d->dc[d->level].style.stroke_dasharray.values[i].computed, "px", display_unit.c_str()); - } - + tmp_style << d->dc[d->level].style.stroke_dasharray.values[i]; } tmp_style << ";"; tmp_style << "stroke-dashoffset:0;"; @@ -1114,21 +1097,17 @@ Emf::select_pen(PEMF_CALLBACK_DATA d, int index) int penstyle = (pEmr->lopn.lopnStyle & U_PS_STYLE_MASK); if (!d->dc[d->level].style.stroke_dasharray.values.empty() && (d->level==0 || (d->level>0 && d->dc[d->level].style.stroke_dasharray.values!=d->dc[d->level-1].style.stroke_dasharray.values))) d->dc[d->level].style.stroke_dasharray.values.clear(); - SVGLength svglength; - svglength.read("1"); if (penstyle==U_PS_DASH || penstyle==U_PS_DASHDOT || penstyle==U_PS_DASHDOTDOT) { - svglength.read("3"); - d->dc[d->level].style.stroke_dasharray.values.push_back( svglength ); - svglength.read("1"); - d->dc[d->level].style.stroke_dasharray.values.push_back( svglength ); + d->dc[d->level].style.stroke_dasharray.values.push_back( 3 ); + d->dc[d->level].style.stroke_dasharray.values.push_back( 1 ); } if (penstyle==U_PS_DOT || penstyle==U_PS_DASHDOT || penstyle==U_PS_DASHDOTDOT) { - d->dc[d->level].style.stroke_dasharray.values.push_back( svglength ); - d->dc[d->level].style.stroke_dasharray.values.push_back( svglength ); + d->dc[d->level].style.stroke_dasharray.values.push_back( 1 ); + d->dc[d->level].style.stroke_dasharray.values.push_back( 1 ); } if (penstyle==U_PS_DASHDOTDOT) { - d->dc[d->level].style.stroke_dasharray.values.push_back( svglength ); - d->dc[d->level].style.stroke_dasharray.values.push_back( svglength ); + d->dc[d->level].style.stroke_dasharray.values.push_back( 1 ); + d->dc[d->level].style.stroke_dasharray.values.push_back( 1 ); } d->dc[d->level].style.stroke_dasharray.set = 1; @@ -1204,9 +1183,7 @@ Emf::select_extpen(PEMF_CALLBACK_DATA d, int index) d->dc[d->level].style.stroke_dasharray.values.clear(); for (unsigned int i=0; i<pEmr->elp.elpNumEntries; i++) { double dash_length = pix_to_abs_size( d, pEmr->elp.elpStyleEntry[i] ); - SVGLength svglength; - svglength.set(SVGLength::PX, dash_length); - d->dc[d->level].style.stroke_dasharray.values.push_back(svglength); + d->dc[d->level].style.stroke_dasharray.values.push_back(dash_length); } d->dc[d->level].style.stroke_dasharray.set = 1; } else { @@ -1223,24 +1200,17 @@ Emf::select_extpen(PEMF_CALLBACK_DATA d, int index) int penstyle = (pEmr->elp.elpPenStyle & U_PS_STYLE_MASK); if (!d->dc[d->level].style.stroke_dasharray.values.empty() && (d->level==0 || (d->level>0 && d->dc[d->level].style.stroke_dasharray.values!=d->dc[d->level-1].style.stroke_dasharray.values))) d->dc[d->level].style.stroke_dasharray.values.clear(); - SVGLength svglength; if (penstyle==U_PS_DASH || penstyle==U_PS_DASHDOT || penstyle==U_PS_DASHDOTDOT) { - svglength.read("3"); - d->dc[d->level].style.stroke_dasharray.values.push_back( svglength ); - svglength.read("2"); - d->dc[d->level].style.stroke_dasharray.values.push_back( svglength ); + d->dc[d->level].style.stroke_dasharray.values.push_back( 3 ); + d->dc[d->level].style.stroke_dasharray.values.push_back( 2 ); } if (penstyle==U_PS_DOT || penstyle==U_PS_DASHDOT || penstyle==U_PS_DASHDOTDOT) { - svglength.read("1"); - d->dc[d->level].style.stroke_dasharray.values.push_back( svglength ); - svglength.read("2"); - d->dc[d->level].style.stroke_dasharray.values.push_back( svglength ); + d->dc[d->level].style.stroke_dasharray.values.push_back( 1 ); + d->dc[d->level].style.stroke_dasharray.values.push_back( 2 ); } if (penstyle==U_PS_DASHDOTDOT) { - svglength.read("1"); - d->dc[d->level].style.stroke_dasharray.values.push_back( svglength ); - svglength.read("2"); - d->dc[d->level].style.stroke_dasharray.values.push_back( svglength ); + d->dc[d->level].style.stroke_dasharray.values.push_back( 1 ); + d->dc[d->level].style.stroke_dasharray.values.push_back( 2 ); } d->dc[d->level].style.stroke_dasharray.set = 1; diff --git a/src/extension/internal/emf-print.cpp b/src/extension/internal/emf-print.cpp index 459794654..254000db3 100644 --- a/src/extension/internal/emf-print.cpp +++ b/src/extension/internal/emf-print.cpp @@ -38,7 +38,7 @@ #include "helper/geom.h" #include "helper/geom-curves.h" #include "util/units.h" -#include "inkscape.h" + #include "inkscape-version.h" #include "extension/system.h" @@ -55,7 +55,6 @@ #include "object/sp-root.h" #include "object/sp-shape.h" #include "object/sp-clippath.h" -#include "object/sp-namedview.h" #include "style.h" #include "display/cairo-utils.h" @@ -696,32 +695,17 @@ int PrintEmf::create_pen(SPStyle const *style, const Geom::Affine &transform) } else { unsigned i = 0; while ((linestyle != U_PS_USERSTYLE) && (i < style->stroke_dasharray.values.size())) { - if (style->stroke_dasharray.values[i].computed > 0.00000001) { + if (style->stroke_dasharray.values[i] > 0.00000001) { linestyle = U_PS_USERSTYLE; } i++; } - + if (linestyle == U_PS_USERSTYLE) { - 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; - } n_dash = style->stroke_dasharray.values.size(); dash = new uint32_t[n_dash]; 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()); - } - dash[i] = MAX(1, (uint32_t) round(scale * dashval * PX2WORLD)); + dash[i] = MAX(1, (uint32_t) round(scale * style->stroke_dasharray.values[i] * PX2WORLD)); } } } @@ -1471,25 +1455,10 @@ unsigned int PrintEmf::stroke( } tlength = length(tmp_pathpw, 0.1); tmp_pathpw2 = arc_length_parametrization(tmp_pathpw); - 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; - } + // go around the dash array repeatedly until the entire path is consumed (but not beyond). 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; } @@ -1500,15 +1469,7 @@ unsigned int PrintEmf::stroke( first_frag = fragment; } slength = elength; - 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 += style->stroke_dasharray.values[i++]; // the gap if (i >= n_dash) { i = 0; } diff --git a/src/extension/internal/javafx-out.cpp b/src/extension/internal/javafx-out.cpp index 9b795ea21..ad8fa855d 100644 --- a/src/extension/internal/javafx-out.cpp +++ b/src/extension/internal/javafx-out.cpp @@ -40,9 +40,7 @@ #include "object/sp-path.h" #include "object/sp-linear-gradient.h" #include "object/sp-radial-gradient.h" -#include "object/sp-namedview.h" #include "style.h" -#include "util/units.h" #include <string> #include <cstdio> @@ -437,38 +435,15 @@ bool JavaFXOutput::doStyle(SPStyle *style) out(" strokeLineJoin: %s\n", getStrokeLineJoin(linejoin).c_str()); out(" strokeMiterLimit: %s\n", DSTR(style->stroke_miterlimit.value)); if (style->stroke_dasharray.set) { - 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; - } - double dash_offset = 0; - if (style->stroke_dashoffset.unit == SVGLength::NONE) { - dash_offset = style->stroke_dashoffset.value; - } else if (style->stroke_dashoffset.unit == SVGLength::PERCENT) { - dash_offset = vbox.width() * style->stroke_dashoffset.value; - } else { - dash_offset = Inkscape::Util::Quantity::convert(style->stroke_dashoffset.computed, "px", display_unit.c_str()); - } if (style->stroke_dashoffset.set) { - out(" strokeDashOffset: %s\n", DSTR(dash_offset)); + out(" strokeDashOffset: %s\n", DSTR(style->stroke_dashoffset.value)); } out(" strokeDashArray: [ "); for(unsigned i = 0; i < style->stroke_dasharray.values.size(); i++ ) { - double dash = 0; - if(style->stroke_dasharray.values[i].unit == SVGLength::NONE) { - dash = style->stroke_dasharray.values[i].value; - } else if (style->stroke_dasharray.values[i].unit == SVGLength::PERCENT) { - dash = vbox.width() * style->stroke_dasharray.values[i].value; - } else { - dash = Inkscape::Util::Quantity::convert(style->stroke_dasharray.values[i].computed, "px", display_unit.c_str()); - } if (i > 0) { - out(", %.2lf", dash); + out(", %.2lf", style->stroke_dasharray.values[i]); }else { - out(" %.2lf", dash); + out(" %.2lf", style->stroke_dasharray.values[i]); } } out(" ]\n"); diff --git a/src/extension/internal/latex-pstricks.cpp b/src/extension/internal/latex-pstricks.cpp index 664ec0310..f3bf06708 100644 --- a/src/extension/internal/latex-pstricks.cpp +++ b/src/extension/internal/latex-pstricks.cpp @@ -23,10 +23,8 @@ #include "util/units.h" #include "helper/geom-curves.h" -#include "object/sp-namedview.h" #include "extension/print.h" #include "extension/system.h" -#include "inkscape.h" #include "inkscape-version.h" #include "io/sys.h" #include "latex-pstricks.h" @@ -242,17 +240,11 @@ unsigned int PrintLatex::stroke(Inkscape::Extension::Print * /*mod*/, if (style->stroke_dasharray.set && !style->stroke_dasharray.values.empty()) { os << ",linestyle=dashed,dash="; - SPDocument * document = SP_ACTIVE_DOCUMENT; - SPNamedView *nv = sp_document_namedview(document, NULL); - Glib::ustring display_unit = "px"; - if (nv) { - display_unit = nv->display_units->abbr; - } for (unsigned i = 0; i < style->stroke_dasharray.values.size(); i++) { if ((i)) { os << " "; } - os << Inkscape::Util::Quantity::convert(style->stroke_dasharray.values[i].computed, "px", display_unit.c_str()); + os << style->stroke_dasharray.values[i]; } } diff --git a/src/extension/internal/wmf-inout.cpp b/src/extension/internal/wmf-inout.cpp index a3df20903..72d44e123 100644 --- a/src/extension/internal/wmf-inout.cpp +++ b/src/extension/internal/wmf-inout.cpp @@ -44,10 +44,8 @@ #include "extension/output.h" #include "display/drawing.h" #include "display/drawing-item.h" -#include "object/sp-namedview.h" #include "clear-n_.h" #include "svg/svg.h" -#include "svg/svg-length.h" #include "util/units.h" // even though it is included indirectly by wmf-inout.h #include "inkscape.h" // even though it is included indirectly by wmf-inout.h @@ -891,23 +889,10 @@ Wmf::output_style(PWMF_CALLBACK_DATA d) !d->dc[d->level].style.stroke_dasharray.values.empty()) { tmp_style << "stroke-dasharray:"; - 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 (unsigned i=0; i<d->dc[d->level].style.stroke_dasharray.values.size(); i++) { if (i) tmp_style << ","; - if(d->dc[d->level].style.stroke_dasharray.values[i].unit == SVGLength::NONE) { - tmp_style << d->dc[d->level].style.stroke_dasharray.values[i].value; - } else if (d->dc[d->level].style.stroke_dasharray.values[i].unit == SVGLength::PERCENT) { - tmp_style << vbox.width() * d->dc[d->level].style.stroke_dasharray.values[i].value; - } else { - tmp_style << Inkscape::Util::Quantity::convert(d->dc[d->level].style.stroke_dasharray.values[i].computed, "px", display_unit.c_str()); - } + tmp_style << d->dc[d->level].style.stroke_dasharray.values[i]; } tmp_style << ";"; tmp_style << "stroke-dashoffset:0;"; @@ -1002,21 +987,17 @@ Wmf::select_pen(PWMF_CALLBACK_DATA d, int index) int penstyle = (up.Style & U_PS_STYLE_MASK); if (!d->dc[d->level].style.stroke_dasharray.values.empty() && (d->level==0 || (d->level>0 && d->dc[d->level].style.stroke_dasharray.values!=d->dc[d->level-1].style.stroke_dasharray.values))) d->dc[d->level].style.stroke_dasharray.values.clear(); - SVGLength svglength; if (penstyle==U_PS_DASH || penstyle==U_PS_DASHDOT || penstyle==U_PS_DASHDOTDOT) { - svglength.read("3"); - d->dc[d->level].style.stroke_dasharray.values.push_back( svglength ); - svglength.read("1"); - d->dc[d->level].style.stroke_dasharray.values.push_back( svglength ); + d->dc[d->level].style.stroke_dasharray.values.push_back( 3 ); + d->dc[d->level].style.stroke_dasharray.values.push_back( 1 ); } - svglength.read("1"); if (penstyle==U_PS_DOT || penstyle==U_PS_DASHDOT || penstyle==U_PS_DASHDOTDOT) { - d->dc[d->level].style.stroke_dasharray.values.push_back( svglength ); - d->dc[d->level].style.stroke_dasharray.values.push_back( svglength ); + d->dc[d->level].style.stroke_dasharray.values.push_back( 1 ); + d->dc[d->level].style.stroke_dasharray.values.push_back( 1 ); } if (penstyle==U_PS_DASHDOTDOT) { - d->dc[d->level].style.stroke_dasharray.values.push_back( svglength ); - d->dc[d->level].style.stroke_dasharray.values.push_back( svglength ); + d->dc[d->level].style.stroke_dasharray.values.push_back( 1 ); + d->dc[d->level].style.stroke_dasharray.values.push_back( 1 ); } d->dc[d->level].style.stroke_dasharray.set = 1; 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; } |
