Code

RegisteredTransformedPoint: fix methods to use const&.
authorjohanengelen <johanengelen@users.sourceforge.net>
Sat, 5 Apr 2008 18:07:10 +0000 (18:07 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Sat, 5 Apr 2008 18:07:10 +0000 (18:07 +0000)
LPE PointParam: set transform in RegisteredTransformedPoint-widget

src/live_effects/parameter/point.cpp
src/ui/widget/registered-widget.cpp
src/ui/widget/registered-widget.h

index 1dbdbd6aacb53ccf170cb1ee0c01e0d275958ed9..a54be8baa76aaf3a495eb2076d5996bb31e3bbf8 100644 (file)
@@ -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"));
index 1fd956897ea9f12982737148eb35d404faf76fa1..6367ce21868edf645245e0b62b63c8a67232d4ad 100644 (file)
@@ -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() ) {
index d5f7591eecb0bb85e30383bbfdaae2a15d930a55..67c7cfef60f797fc0d5882660c4987df917d5496 100644 (file)
@@ -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;