From: johanengelen Date: Sat, 5 Apr 2008 18:07:10 +0000 (+0000) Subject: RegisteredTransformedPoint: fix methods to use const&. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7e06f69b2d196711819d5fb5935e09cd89734bb4;p=inkscape.git RegisteredTransformedPoint: fix methods to use const&. LPE PointParam: set transform in RegisteredTransformedPoint-widget --- diff --git a/src/live_effects/parameter/point.cpp b/src/live_effects/parameter/point.cpp index 1dbdbd6aa..a54be8baa 100644 --- a/src/live_effects/parameter/point.cpp +++ b/src/live_effects/parameter/point.cpp @@ -24,6 +24,7 @@ #include "shape-editor.h" #include "desktop.h" #include "selection.h" +#include "libnr/nr-convert2geom.h" namespace Inkscape { @@ -85,6 +86,10 @@ PointParam::param_newWidget(Gtk::Tooltips * tooltips) *param_wr, param_effect->getRepr(), param_effect->getSPDoc() ) ); + // TODO: fix to get correct desktop (don't use SP_ACTIVE_DESKTOP) + SPDesktop *desktop = SP_ACTIVE_DESKTOP; + Geom::Matrix transf = to_2geom(desktop->doc2dt()); + pointwdg->setTransform(transf); pointwdg->setValue( *this ); pointwdg->clearProgrammatically(); pointwdg->set_undo_parameters(SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Change point parameter")); diff --git a/src/ui/widget/registered-widget.cpp b/src/ui/widget/registered-widget.cpp index 1fd956897..6367ce218 100644 --- a/src/ui/widget/registered-widget.cpp +++ b/src/ui/widget/registered-widget.cpp @@ -493,14 +493,14 @@ RegisteredTransformedPoint::RegisteredTransformedPoint ( const Glib::ustring& la } void -RegisteredTransformedPoint::setValue(Geom::Point & p) +RegisteredTransformedPoint::setValue(Geom::Point const & p) { Geom::Point new_p = p * to_svg.inverse(); Point::setValue(new_p); // the Point widget should display things in canvas coordinates } void -RegisteredTransformedPoint::setTransform(Geom::Matrix & canvas_to_svg) +RegisteredTransformedPoint::setTransform(Geom::Matrix const & canvas_to_svg) { // check if matrix is singular / has inverse if ( ! canvas_to_svg.isSingular() ) { diff --git a/src/ui/widget/registered-widget.h b/src/ui/widget/registered-widget.h index d5f7591ee..67c7cfef6 100644 --- a/src/ui/widget/registered-widget.h +++ b/src/ui/widget/registered-widget.h @@ -305,9 +305,9 @@ public: SPDocument *doc_in = NULL ); // redefine setValue, because transform must be applied - void setValue(Geom::Point & p); + void setValue(Geom::Point const & p); - void setTransform(Geom::Matrix & canvas_to_svg); + void setTransform(Geom::Matrix const & canvas_to_svg); protected: sigc::connection _value_x_changed_connection;