From 7aaeaacc08de60fd324646afe69f4dbed93f89d4 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Sun, 10 Jun 2018 16:20:18 +0200 Subject: Allow inkscape handle units and percent in dasharray and dashoffset. Add pref optional to scale dashes on stroke scale --- src/object/sp-item.cpp | 5 +++-- src/object/sp-item.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/object') diff --git a/src/object/sp-item.cpp b/src/object/sp-item.cpp index ec92c655f..fd27a6e90 100644 --- a/src/object/sp-item.cpp +++ b/src/object/sp-item.cpp @@ -1307,9 +1307,10 @@ void SPItem::adjust_stroke( gdouble ex ) if ( !style->stroke_dasharray.values.empty() ) { for (unsigned i = 0; i < style->stroke_dasharray.values.size(); i++) { - style->stroke_dasharray.values[i] *= ex; + style->stroke_dasharray.values[i].scale(ex); } - style->stroke_dashoffset.value *= ex; + style->stroke_dashoffset.value = style->stroke_dashoffset.value * ex; + style->stroke_dashoffset.computed = style->stroke_dashoffset.computed * ex; } updateRepr(); diff --git a/src/object/sp-item.h b/src/object/sp-item.h index f6a6781e9..9651f9f26 100644 --- a/src/object/sp-item.h +++ b/src/object/sp-item.h @@ -395,7 +395,7 @@ public: virtual Geom::OptRect bbox(Geom::Affine const &transform, SPItem::BBoxType type) const; virtual void print(SPPrintContext *ctx); - virtual const char* displayName() const; + virtual const char* displayName() const; virtual char* description() const; virtual Inkscape::DrawingItem* show(Inkscape::Drawing &drawing, unsigned int key, unsigned int flags); virtual void hide(unsigned int key); -- cgit v1.2.3