From ef76ff1e8fcdf28c9b7ee0feff34d1960ba07260 Mon Sep 17 00:00:00 2001 From: johanengelen Date: Thu, 19 Mar 2009 23:42:16 +0000 Subject: [PATCH] change color of LPE helperpaths in nodetool --- src/nodepath.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/nodepath.cpp b/src/nodepath.cpp index b59a2d865..ed356e5c4 100644 --- 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 > helper_path_vec; @@ -198,7 +192,10 @@ sp_nodepath_create_helperpaths(Inkscape::NodePath::Path *np) { // create new canvas items from the effect's helper paths std::vector hpaths = lpe->getHelperPaths(lpeitem); for (std::vector::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(); } } } @@ -384,7 +381,7 @@ Inkscape::NodePath::Path *sp_nodepath_new(SPDesktop *desktop, SPObject *object, // 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); -- 2.30.2