diff options
| author | Maximilian Albert <maximilian.albert@gmail.com> | 2008-07-29 14:49:40 +0000 |
|---|---|---|
| committer | cilix42 <cilix42@users.sourceforge.net> | 2008-07-29 14:49:40 +0000 |
| commit | 70a05bc08bae10f00ba33415f5162b71e110d3b4 (patch) | |
| tree | bbf0ab490b347aeec457d47828cbcabfcb3c54bd /src/live_effects/effect.cpp | |
| parent | added new translation from Martin Srebotnjak (diff) | |
| download | inkscape-70a05bc08bae10f00ba33415f5162b71e110d3b4.tar.gz inkscape-70a05bc08bae10f00ba33415f5162b71e110d3b4.zip | |
LPE knotholder refactoring: PointParams are not knotholder entities any more; instead, every parameter type can now return entities (and then forget about them)
(bzr r6446)
Diffstat (limited to 'src/live_effects/effect.cpp')
| -rw-r--r-- | src/live_effects/effect.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 289d22172..c4bbc31e1 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -422,6 +422,9 @@ Effect::registerKnotHolderHandle(KnotHolderEntity* entity, const char* descr) */ void Effect::addHandles(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item) { + using namespace Inkscape::LivePathEffect; + + // add handles provided by the effect itself std::vector<std::pair<KnotHolderEntity*, const char*> >::iterator i; for (i = kh_entity_vector.begin(); i != kh_entity_vector.end(); ++i) { KnotHolderEntity *entity = i->first; @@ -430,18 +433,10 @@ Effect::addHandles(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item) { entity->create(desktop, item, knotholder, descr); knotholder->add(entity); } -} -void -Effect::addPointParamHandles(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item) { - using namespace Inkscape::LivePathEffect; + // add handles provided by the effect's parameters (if any) for (std::vector<Parameter *>::iterator p = param_vector.begin(); p != param_vector.end(); ++p) { - if ( Inkscape::LivePathEffect::PointParam *pparam = dynamic_cast<Inkscape::LivePathEffect::PointParam*>(*p) ) { - KnotHolderEntity *e = dynamic_cast<KnotHolderEntity *>(*p); - e->create(desktop, item, knotholder, pparam->handleTip(), - pparam->knotShape(), pparam->knotMode(), pparam->knotColor()); - knotholder->add(e); - } + (*p)->addKnotHolderEntities(knotholder, desktop, item); } } @@ -612,6 +607,7 @@ Effect::transform_multiply(Geom::Matrix const& postmul, bool set) } } +// TODO: take _all_ parameters into account, not only PointParams bool Effect::providesKnotholder() { |
