summaryrefslogtreecommitdiffstats
path: root/src/widgets/stroke-style.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/stroke-style.cpp')
-rw-r--r--src/widgets/stroke-style.cpp15
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);
}