summaryrefslogtreecommitdiffstats
path: root/src/extension/internal/wmf-print.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2014-03-11 14:52:08 +0000
committertavmjong-free <tavmjong@free.fr>2014-03-11 14:52:08 +0000
commit1d31728fb7399f48d272560a290dc990b75a197e (patch)
treea343611a11ff84857602a12ef0bf872cfa28cf56 /src/extension/internal/wmf-print.cpp
parentAdd a few more style tests. (diff)
downloadinkscape-1d31728fb7399f48d272560a290dc990b75a197e.tar.gz
inkscape-1d31728fb7399f48d272560a290dc990b75a197e.zip
Change stroke-dasharray and stroke-dashoffset handling to match other properties.
Split style.h into more manageable size files. (bzr r13135)
Diffstat (limited to 'src/extension/internal/wmf-print.cpp')
-rw-r--r--src/extension/internal/wmf-print.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/extension/internal/wmf-print.cpp b/src/extension/internal/wmf-print.cpp
index 32c7ac0bd..232891c9c 100644
--- a/src/extension/internal/wmf-print.cpp
+++ b/src/extension/internal/wmf-print.cpp
@@ -596,8 +596,7 @@ int PrintWmf::create_pen(SPStyle const *style, const Geom::Affine &transform)
modstyle |= U_PS_JOIN_BEVEL;
}
- if (style->stroke_dash.n_dash &&
- style->stroke_dash.dash) {
+ 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
}
@@ -824,7 +823,7 @@ unsigned int PrintWmf::fill(
}
if (
(style->stroke.isNone() || style->stroke.noneSet || style->stroke_width.computed == 0.0) ||
- (style->stroke_dash.n_dash && style->stroke_dash.dash && FixPPTDashLine) ||
+ (!style->stroke_dasharray.values.empty() && FixPPTDashLine) ||
!all_closed
) {
print_pathv(pathv, fill_transform); // do any fills. side effect: clears fill_pathv
@@ -852,13 +851,13 @@ unsigned int PrintWmf::stroke(
return 0;
}
- if (style->stroke_dash.n_dash && style->stroke_dash.dash && FixPPTDashLine) {
+ if (!style->stroke_dasharray.values.empty() && FixPPTDashLine) {
// convert the path, gets its complete length, and then make a new path with parameter length instead of t
Geom::Piecewise<Geom::D2<Geom::SBasis> > tmp_pathpw; // pathv-> sbasis
Geom::Piecewise<Geom::D2<Geom::SBasis> > tmp_pathpw2; // sbasis using arc length parameter
Geom::Piecewise<Geom::D2<Geom::SBasis> > tmp_pathpw3; // new (discontinuous) path, composed of dots/dashes
Geom::Piecewise<Geom::D2<Geom::SBasis> > first_frag; // first fragment, will be appended at end
- int n_dash = style->stroke_dash.n_dash;
+ int n_dash = style->stroke_dasharray.values.size();
int i = 0; //dash index
double tlength; // length of tmp_pathpw
double slength = 0.0; // start of gragment
@@ -871,7 +870,7 @@ unsigned int PrintWmf::stroke(
// go around the dash array repeatedly until the entire path is consumed (but not beyond).
while (slength < tlength) {
- elength = slength + style->stroke_dash.dash[i++];
+ elength = slength + style->stroke_dasharray.values[i++];
if (elength > tlength) {
elength = tlength;
}
@@ -882,7 +881,7 @@ unsigned int PrintWmf::stroke(
first_frag = fragment;
}
slength = elength;
- slength += style->stroke_dash.dash[i++]; // the gap
+ slength += style->stroke_dasharray.values[i++]; // the gap
if (i >= n_dash) {
i = 0;
}