diff --git a/src/nodepath.cpp b/src/nodepath.cpp
index b59a2d8655441acb595f84cdacdb996ef8badd18..ad230df75645ee1934933a75418cb3d5798a059f 100644 (file)
--- a/src/nodepath.cpp
+++ b/src/nodepath.cpp
@@ -161,11 +161,11 @@ static void sp_nodepath_set_curve (Inkscape::NodePath::Path *np, SPCurve *curve)
Inkscape::NodePath::Node * Inkscape::NodePath::Path::active_node = NULL;
static SPCanvasItem *
-sp_nodepath_make_helper_item(Inkscape::NodePath::Path *np, /*SPDesktop *desktop, */const SPCurve *curve, bool show = false) {
+sp_nodepath_make_helper_item(Inkscape::NodePath::Path *np, /*SPDesktop *desktop, */const SPCurve *curve, bool show = false, guint32 color = 0xff0000ff) {
SPCurve *helper_curve = curve->copy();
helper_curve->transform(np->i2d);
SPCanvasItem *helper_path = sp_canvas_bpath_new(sp_desktop_controls(np->desktop), helper_curve);
- sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(helper_path), np->helperpath_rgba, np->helperpath_width, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT);
+ sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(helper_path), color, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT);
sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(helper_path), 0, SP_WIND_RULE_NONZERO);
sp_canvas_item_move_to_z(helper_path, 0);
if (show) {
@@ -175,12 +175,6 @@ sp_nodepath_make_helper_item(Inkscape::NodePath::Path *np, /*SPDesktop *desktop,
return helper_path;
}
-static SPCanvasItem *
-canvasitem_from_pathvec(Inkscape::NodePath::Path *np, Geom::PathVector const &pathv, bool show) {
- SPCurve *helper_curve = new SPCurve(pathv);
- return sp_nodepath_make_helper_item(np, helper_curve, show);
-}
-
static void
sp_nodepath_create_helperpaths(Inkscape::NodePath::Path *np) {
//std::map<Inkscape::LivePathEffect::Effect *, std::vector<SPCanvasItem *> > helper_path_vec;
// create new canvas items from the effect's helper paths
std::vector<Geom::PathVector> hpaths = lpe->getHelperPaths(lpeitem);
for (std::vector<Geom::PathVector>::iterator j = hpaths.begin(); j != hpaths.end(); ++j) {
- np->helper_path_vec[lpe].push_back(canvasitem_from_pathvec(np, *j, true));
+ SPCurve *helper_curve = new SPCurve(*j);
+ SPCanvasItem * canvasitem = sp_nodepath_make_helper_item(np, helper_curve, true, 0x509050dd);
+ np->helper_path_vec[lpe].push_back(canvasitem);
+ helper_curve->unref();
}
}
}
// Draw helper curve
if (np->show_helperpath) {
- np->helper_path = sp_nodepath_make_helper_item(np, /*desktop, */np->curve, true);
+ np->helper_path = sp_nodepath_make_helper_item(np, /*desktop, */np->curve, true, np->helperpath_rgba);
}
sp_nodepath_create_helperpaths(np);
@@ -1391,7 +1388,7 @@ static void sp_nodepath_selected_nodes_move(Inkscape::NodePath::Path *nodepath,
}
// Iterate through all selected nodes
- m.setup(nodepath->desktop, false, SP_PATH(nodepath->item), &unselected_nodes);
+ m.setup(nodepath->desktop, false, nodepath->item, &unselected_nodes);
for (GList *l = nodepath->selected; l != NULL; l = l->next) {
Inkscape::NodePath::Node *n = (Inkscape::NodePath::Node *) l->data;
if (!closest_only || n == closest_node) { //try to snap either all selected nodes or only the closest one
}
n->is_dragging = true;
- //sp_canvas_set_snap_delay_active(n->subpath->nodepath->desktop->canvas, true);
+ //sp_event_context_snap_window_open(n->subpath->nodepath->desktop->canvas);
// Reconstruct and store the location of the mouse pointer at the time when we started dragging (needed for snapping)
n->subpath->nodepath->drag_origin_mouse = knot->grabbed_rel_pos + knot->drag_origin;
n->dragging_out = NULL;
n->is_dragging = false;
- //sp_canvas_set_snap_delay_active(n->subpath->nodepath->desktop->canvas, false);
+ //sp_event_context_snap_window_closed(n->subpath->nodepath->desktop->canvas);
n->subpath->nodepath->drag_origin_mouse = Geom::Point(NR_HUGE, NR_HUGE);
sp_canvas_end_forced_full_redraws(n->subpath->nodepath->desktop->canvas);