Code

now that selection description includes style (filtered, clipped), we need to update...
[inkscape.git] / src / lpe-tool-context.cpp
index 8439f7086871b9f2945d180c9c18f6bc81998f6f..30248edd0bc148703fa91badda8f82ea6e65f8d0 100644 (file)
@@ -203,9 +203,10 @@ sp_lpetool_context_selection_changed(Inkscape::Selection *selection, gpointer da
 static void
 sp_lpetool_context_set(SPEventContext *ec, Inkscape::Preferences::Entry *val)
 {
-    // FIXME: how to set this correcly? the value from preferences-skeleton.h doesn't seem to get
-    // read (it wants to set drag = 1)
-    // lpetool_parent_class->set(ec, key, "drag");
+    if (val->getEntryName() == "mode") {
+        Inkscape::Preferences::get()->setString("/tools/geometric/mode", "drag");
+        SP_PEN_CONTEXT(ec)->mode = SP_PEN_CONTEXT_MODE_DRAG;
+    }
 
     /*
     //pass on up to parent class to handle common attributes.
@@ -285,7 +286,7 @@ sp_lpetool_context_root_handler(SPEventContext *event_context, GdkEvent *event)
                 int mode = prefs->getInt("/tools/lpetool/mode");
                 EffectType type = lpesubtools[mode];
 
-                //bool over_stroke = lc->shape_editor->is_over_stroke(NR::Point(event->button.x, event->button.y), true);
+                //bool over_stroke = lc->shape_editor->is_over_stroke(Geom::Point(event->button.x, event->button.y), true);
 
                 sp_pen_context_wait_for_LPE_mouse_clicks(lc, type, Inkscape::LivePathEffect::Effect::acceptsNumClicks(type));
 
@@ -300,7 +301,7 @@ sp_lpetool_context_root_handler(SPEventContext *event_context, GdkEvent *event)
             }
 
             bool over_stroke = false;
-            over_stroke = lc->shape_editor->is_over_stroke(NR::Point(event->motion.x, event->motion.y), false);
+            over_stroke = lc->shape_editor->is_over_stroke(Geom::Point(event->motion.x, event->motion.y), false);
 
             if (over_stroke) {
                 event_context->cursor_shape = cursor_node_xpm;
@@ -374,7 +375,7 @@ lpetool_mode_to_index(Inkscape::LivePathEffect::EffectType const type) {
  * Checks whether an item has a construction applied as LPE and if so returns the index in
  * lpesubtools of this construction
  */
-int lpetool_item_has_construction(SPLPEToolContext *lc, SPItem *item)
+int lpetool_item_has_construction(SPLPEToolContext */*lc*/, SPItem *item)
 {
     if (!SP_IS_LPE_ITEM(item)) {
         return -1;
@@ -453,7 +454,7 @@ lpetool_context_reset_limiting_bbox(SPLPEToolContext *lc)
 
     Geom::Point A, B;
     lpetool_get_limiting_bbox_corners(document, A, B);
-    NR::Matrix doc2dt(lc->desktop->doc2dt());
+    Geom::Matrix doc2dt(lc->desktop->doc2dt());
     A *= doc2dt;
     B *= doc2dt;
 
@@ -466,7 +467,7 @@ lpetool_context_reset_limiting_bbox(SPLPEToolContext *lc)
 
 static void
 set_pos_and_anchor(SPCanvasText *canvas_text, const Geom::Piecewise<Geom::D2<Geom::SBasis> > &pwd2,
-                   const double t, const double length, bool use_curvature = false)
+                   const double t, const double length, bool /*use_curvature*/ = false)
 {
     using namespace Geom;