diff options
| author | Liam P. White <inkscapebronyat-signgmaildotcom> | 2014-03-12 15:13:08 +0000 |
|---|---|---|
| committer | Liam P. White <inkscapebronyat-signgmaildotcom> | 2014-03-12 15:13:08 +0000 |
| commit | 309112136c71cbb4f62fb850c6f6f12e32a67a8e (patch) | |
| tree | 58e867ed84ddbc721113b948d4b6365cef02338a /src/widgets/stroke-style.cpp | |
| parent | Reverted swatches (diff) | |
| parent | Change stroke-dasharray and stroke-dashoffset handling to match other propert... (diff) | |
| download | inkscape-309112136c71cbb4f62fb850c6f6f12e32a67a8e.tar.gz inkscape-309112136c71cbb4f62fb850c6f6f12e32a67a8e.zip | |
Updated to trunk
(bzr r13090.1.24)
Diffstat (limited to 'src/widgets/stroke-style.cpp')
| -rw-r--r-- | src/widgets/stroke-style.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/widgets/stroke-style.cpp b/src/widgets/stroke-style.cpp index d140cfb21..9567f81ba 100644 --- a/src/widgets/stroke-style.cpp +++ b/src/widgets/stroke-style.cpp @@ -24,6 +24,7 @@ #include "svg/svg-color.h" #include "util/units.h" #include "ui/widget/unit-menu.h" +#include "desktop-widget.h" using Inkscape::DocumentUndo; using Inkscape::Util::unit_table; @@ -726,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); } |
