From 9b91f5d8683af39ec035e7116154a91d5d2ae4da Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 3 Nov 2007 17:38:18 +0000 Subject: make setup_notepath function for LPE's and LPE parameters. (bzr r4018) --- src/nodepath.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/nodepath.cpp') diff --git a/src/nodepath.cpp b/src/nodepath.cpp index 02b91eab0..5b7565195 100644 --- a/src/nodepath.cpp +++ b/src/nodepath.cpp @@ -48,6 +48,7 @@ #include #include #include "live_effects/lpeobject.h" +#include "live_effects/parameter/parameter.h" class NR::Matrix; @@ -218,17 +219,18 @@ Inkscape::NodePath::Path *sp_nodepath_new(SPDesktop *desktop, SPObject *object, if (repr_key_in) { // apparantly the object is an LPEObject np->repr_key = g_strdup(repr_key_in); np->repr_nodetypes_key = g_strconcat(np->repr_key, "-nodetypes", NULL); - np->show_helperpath = true; + Inkscape::LivePathEffect::Parameter *lpeparam = LIVEPATHEFFECT(object)->lpe->getParameter(repr_key_in); + if (lpeparam) { + lpeparam->param_setup_notepath(np); + } } else { np->repr_nodetypes_key = g_strdup("sodipodi:nodetypes"); if ( SP_SHAPE(np->object)->path_effect_href ) { np->repr_key = g_strdup("inkscape:original-d"); - np->show_helperpath = true; + LivePathEffectObject *lpeobj = sp_shape_get_livepatheffectobject(SP_SHAPE(np->object)); - // ENHANCE THIS. Probably it is much nicer to have a virtual method in Effect class that modifies nodepath to its likings. - // so something like: "lpe->adjust_nodepath(np);" if (lpeobj && lpeobj->lpe) { - np->straight_path = lpeobj->lpe->straight_original_path; + lpeobj->lpe->setup_notepath(np); } } else { np->repr_key = g_strdup("d"); @@ -258,7 +260,7 @@ Inkscape::NodePath::Path *sp_nodepath_new(SPDesktop *desktop, SPObject *object, SPCurve *helper_curve = sp_curve_copy(np->curve); sp_curve_transform(helper_curve, np->i2d ); np->helper_path = sp_canvas_bpath_new(sp_desktop_controls(desktop), helper_curve); - sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(np->helper_path), 0xff0000ff, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT); + sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(np->helper_path), np->helperpath_rgba, np->helperpath_width, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT); sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(np->helper_path), 0, SP_WIND_RULE_NONZERO); sp_canvas_item_show(np->helper_path); sp_curve_unref(helper_curve); -- cgit v1.2.3