diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-01-08 19:52:22 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-01-08 19:52:22 +0000 |
| commit | 69dfe313e8757e0db085555b5f2de0c258618f2f (patch) | |
| tree | 401a09357b96733490e5e11923c58b86c2a1fe92 /src | |
| parent | * [INTL: nl] Dutch update by Foppe Benedictus (closes: #181283) (diff) | |
| download | inkscape-69dfe313e8757e0db085555b5f2de0c258618f2f.tar.gz inkscape-69dfe313e8757e0db085555b5f2de0c258618f2f.zip | |
correctly transform LPE path and point parameters with the SPItem's transform
(bzr r4433)
Diffstat (limited to 'src')
| -rw-r--r-- | src/live_effects/parameter/parameter.cpp | 5 | ||||
| -rw-r--r-- | src/live_effects/parameter/parameter.h | 2 | ||||
| -rw-r--r-- | src/live_effects/parameter/path.cpp | 5 | ||||
| -rw-r--r-- | src/live_effects/parameter/path.h | 4 | ||||
| -rw-r--r-- | src/live_effects/parameter/point.cpp | 16 | ||||
| -rw-r--r-- | src/live_effects/parameter/point.h | 4 |
6 files changed, 29 insertions, 7 deletions
diff --git a/src/live_effects/parameter/parameter.cpp b/src/live_effects/parameter/parameter.cpp index 500578db4..893f0d7f1 100644 --- a/src/live_effects/parameter/parameter.cpp +++ b/src/live_effects/parameter/parameter.cpp @@ -38,6 +38,11 @@ Parameter::Parameter( const Glib::ustring& label, const Glib::ustring& tip, } +void +Parameter::param_write_to_repr(const char * svgd) +{ + param_effect->getRepr()->setAttribute(param_key.c_str(), svgd); +} /*########################################### * REAL PARAM diff --git a/src/live_effects/parameter/parameter.h b/src/live_effects/parameter/parameter.h index 08af7f928..e3d372706 100644 --- a/src/live_effects/parameter/parameter.h +++ b/src/live_effects/parameter/parameter.h @@ -68,6 +68,8 @@ protected: Effect* param_effect; + void param_write_to_repr(const char * svgd); + private: Parameter(const Parameter&); Parameter& operator=(const Parameter&); diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index 9bc81d521..1f0e6f3be 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -150,12 +150,11 @@ PathParam::param_setup_nodepath(Inkscape::NodePath::Path *np) } void -PathParam::param_write_to_repr(const char * svgd) +PathParam::param_transform_multiply(Geom::Matrix const& postmul, bool /*set*/) { - param_effect->getRepr()->setAttribute(param_key.c_str(), svgd); + param_set_and_write_new_value( (*this) * postmul ); } - void PathParam::param_set_and_write_new_value (Geom::Piecewise<Geom::D2<Geom::SBasis> > newpath) { diff --git a/src/live_effects/parameter/path.h b/src/live_effects/parameter/path.h index a269f3e4f..82e240310 100644 --- a/src/live_effects/parameter/path.h +++ b/src/live_effects/parameter/path.h @@ -49,7 +49,7 @@ public: void param_editOncanvas(SPItem * item, SPDesktop * dt); void param_setup_nodepath(Inkscape::NodePath::Path *np); - virtual void param_transform_multiply(Geom::Matrix const& /*postmul*/, bool /*set*/) {}; + virtual void param_transform_multiply(Geom::Matrix const& /*postmul*/, bool /*set*/); sigc::signal <void> signal_path_pasted; sigc::signal <void> signal_path_changed; @@ -61,8 +61,6 @@ private: Gtk::Widget * _widget; Gtk::Tooltips * _tooltips; - void param_write_to_repr(const char * svgd); - void on_edit_button_click(); void on_paste_button_click(); diff --git a/src/live_effects/parameter/point.cpp b/src/live_effects/parameter/point.cpp index 3d13ed12d..eea337c85 100644 --- a/src/live_effects/parameter/point.cpp +++ b/src/live_effects/parameter/point.cpp @@ -118,6 +118,22 @@ PointParam::param_setValue(Geom::Point newpoint) pointwdg->setValue(newpoint[0], newpoint[1]); } +void +PointParam::param_set_and_write_new_value (Geom::Point newpoint) +{ + Inkscape::SVGOStringStream os; + os << newpoint[0] << "," << newpoint[1]; + gchar * str = g_strdup(os.str().c_str()); + param_write_to_repr(str); + g_free(str); +} + +void +PointParam::param_transform_multiply(Geom::Matrix const& postmul, bool /*set*/) +{ + param_set_and_write_new_value( (*this) * postmul ); +} + // CALLBACKS: diff --git a/src/live_effects/parameter/point.h b/src/live_effects/parameter/point.h index 72b3991e1..688a50d4a 100644 --- a/src/live_effects/parameter/point.h +++ b/src/live_effects/parameter/point.h @@ -43,7 +43,9 @@ public: void param_setValue(Geom::Point newpoint); void param_set_default(); - virtual void param_transform_multiply(Geom::Matrix const& /*postmul*/, bool /*set*/) {}; + void param_set_and_write_new_value(Geom::Point newpoint); + + virtual void param_transform_multiply(Geom::Matrix const& /*postmul*/, bool /*set*/); private: PointParam(const PointParam&); |
