From 4e8bfe1693fe11e16c7f6aa94348895d94eff3c1 Mon Sep 17 00:00:00 2001 From: Maximilian Albert Date: Wed, 18 Jun 2008 22:30:36 +0000 Subject: Display helper grid for LPELattice; automatically add helper paths for LPE PathParams (bzr r5996) --- src/live_effects/effect.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/live_effects/effect.cpp') diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 4e500a498..9326f54b9 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -434,11 +434,21 @@ Effect::addHelperPaths(SPLPEItem *lpeitem, SPDesktop *desktop) // must create the helper curve for the original path manually; once we allow nodepaths and // knotholders alongside each other, this needs to be rethought! SPCanvasItem *canvasitem = sp_nodepath_generate_helperpath(desktop, SP_PATH(lpeitem)); - // TODO: Make sure the tempitem doesn't get destroyed when the mouse leaves the item Inkscape::Display::TemporaryItem* tmpitem = desktop->add_temporary_canvasitem (canvasitem, 0); lpeitem->lpe_helperpaths.push_back(tmpitem); } + for (std::vector::iterator p = param_vector.begin(); p != param_vector.end(); ++p) { + if ((*p)->paramType() == Inkscape::LivePathEffect::PATH_PARAM) { + SPCurve *c = new SPCurve(static_cast(*p)->get_pathvector()); + + // TODO: factor this out (also the copied code above); see also lpe-lattice.cpp + SPCanvasItem *canvasitem = sp_nodepath_generate_helperpath(desktop, c, SP_ITEM(lpeitem), 0x009000ff); + Inkscape::Display::TemporaryItem* tmpitem = desktop->add_temporary_canvasitem (canvasitem, 0); + lpeitem->lpe_helperpaths.push_back(tmpitem); + } + } + addHelperPathsImpl(lpeitem, desktop); } -- cgit v1.2.3