diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2007-08-19 20:34:48 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2007-08-19 20:34:48 +0000 |
| commit | b9745837eda971495b8aa0b91988c8ee3adef109 (patch) | |
| tree | aa294309c3c348e35708a12b43032918c33ffadb /src/live_effects/effect.cpp | |
| parent | Remove the clipping path emitted before the 'sh' operator since that same pat... (diff) | |
| download | inkscape-b9745837eda971495b8aa0b91988c8ee3adef109.tar.gz inkscape-b9745837eda971495b8aa0b91988c8ee3adef109.zip | |
Add default value stuff for LPE parameters
(bzr r3536)
Diffstat (limited to 'src/live_effects/effect.cpp')
| -rw-r--r-- | src/live_effects/effect.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 901b80fcc..1e86ab479 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -129,7 +129,7 @@ std::vector<Geom::Path> Effect::doEffect (std::vector<Geom::Path> & path_in)
{
Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2_in;
- // FIXME: find standard function to convert std::vector<Geom::Path> ==> Piecewise< D2<SBasis> >
+
for (unsigned int i=0; i < path_in.size(); i++) {
pwd2_in.concat( path_in[i].toPwSb() );
}
@@ -169,11 +169,18 @@ Effect::setParameter(Inkscape::XML::Node * repr, const gchar * key, const gchar param_map_type::iterator it = param_map.find(stringkey);
if (it != param_map.end()) {
- bool accepted = it->second->param_readSVGValue(new_value);
- /* think: can this backfire and create infinite loop when started with unacceptable old_value?
- if (!accepted) { // change was not accepted, so change it back.
- repr->setAttribute(key, old_value);
- } */
+ if (new_value) {
+ bool accepted = it->second->param_readSVGValue(new_value);
+ if (!accepted) {
+ g_warning("Effect::setParameter - '%s' not accepted for %s", new_value, key);
+ // change was not accepted, so change it back.
+ // think: can this backfire and create infinite loop when started with unacceptable old_value?
+ // repr->setAttribute(key, old_value);
+ }
+ } else {
+ // set default value
+ it->second->param_set_default();
+ }
}
}
|
