summaryrefslogtreecommitdiffstats
path: root/src/widgets/stroke-style.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/widgets/stroke-style.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/widgets/stroke-style.cpp')
-rw-r--r--src/widgets/stroke-style.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/widgets/stroke-style.cpp b/src/widgets/stroke-style.cpp
index dbfb1bcd2..9567f81ba 100644
--- a/src/widgets/stroke-style.cpp
+++ b/src/widgets/stroke-style.cpp
@@ -727,18 +727,18 @@ StrokeStyle::getItemColorForMarker(SPItem *item, Inkscape::PaintTarget fill_or_s
void
StrokeStyle::setDashSelectorFromStyle(SPDashSelector *dsel, SPStyle *style)
{
- if (style->stroke_dash.n_dash > 0) {
+ if (!style->stroke_dasharray.values.empty()) {
double d[64];
- int len = MIN(style->stroke_dash.n_dash, 64);
- for (int i = 0; i < len; i++) {
+ size_t len = MIN(style->stroke_dasharray.values.size(), 64);
+ for (unsigned i = 0; i < len; i++) {
if (style->stroke_width.computed != 0)
- d[i] = style->stroke_dash.dash[i] / style->stroke_width.computed;
+ d[i] = style->stroke_dasharray.values[i] / style->stroke_width.computed;
else
- d[i] = style->stroke_dash.dash[i]; // is there a better thing to do for stroke_width==0?
+ d[i] = style->stroke_dasharray.values[i]; // is there a better thing to do for stroke_width==0?
}
dsel->set_dash(len, d, style->stroke_width.computed != 0 ?
- style->stroke_dash.offset / style->stroke_width.computed :
- style->stroke_dash.offset);
+ style->stroke_dashoffset.value / style->stroke_width.computed :
+ style->stroke_dashoffset.value);
} else {
dsel->set_dash(0, NULL, 0.0);
}