diff options
| author | Nicholas Bishop <nicholasbishop@gmail.com> | 2007-08-12 09:35:38 +0000 |
|---|---|---|
| committer | nicholasbishop <nicholasbishop@users.sourceforge.net> | 2007-08-12 09:35:38 +0000 |
| commit | e85ccdf642c13d03eb1ea758bfcb534e5023f63b (patch) | |
| tree | 8092bdbe87ae7ab7de6d59fa1e213fac06dd1b46 /src/sp-feturbulence.cpp | |
| parent | Filter effects dialog: (diff) | |
| download | inkscape-e85ccdf642c13d03eb1ea758bfcb534e5023f63b.tar.gz inkscape-e85ccdf642c13d03eb1ea758bfcb534e5023f63b.zip | |
Filter effects dialog:
* Changed SPFeTurbulence/FilterTurbulence to use an enum for the type field
* Added type setting to the filter dialog
(bzr r3454)
Diffstat (limited to 'src/sp-feturbulence.cpp')
| -rw-r--r-- | src/sp-feturbulence.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/sp-feturbulence.cpp b/src/sp-feturbulence.cpp index effdd777e..dfff840e0 100644 --- a/src/sp-feturbulence.cpp +++ b/src/sp-feturbulence.cpp @@ -129,17 +129,17 @@ static bool sp_feTurbulence_read_stitchTiles(gchar const *value){ return false; // 'noStitch' is default } -static int sp_feTurbulence_read_type(gchar const *value){ - if (!value) return 1; // 'turbulence' is default +static NR::FilterTurbulenceType sp_feTurbulence_read_type(gchar const *value){ + if (!value) return NR::TURBULENCE_TURBULENCE; // 'turbulence' is default switch(value[0]){ case 'f': - if (strncmp(value, "fractalNoise", 12) == 0) return 0; + if (strncmp(value, "fractalNoise", 12) == 0) return NR::TURBULENCE_FRACTALNOISE; break; case 't': - if (strncmp(value, "turbulence", 10) == 0) return 1; + if (strncmp(value, "turbulence", 10) == 0) return NR::TURBULENCE_TURBULENCE; break; } - return 1; // 'turbulence' is default + return NR::TURBULENCE_TURBULENCE; // 'turbulence' is default } /** @@ -154,6 +154,7 @@ sp_feTurbulence_set(SPObject *object, unsigned int key, gchar const *value) int read_int; double read_num; bool read_bool; + NR::FilterTurbulenceType read_type; switch(key) { /*DEAL WITH SETTING ATTRIBUTES HERE*/ @@ -187,9 +188,9 @@ sp_feTurbulence_set(SPObject *object, unsigned int key, gchar const *value) } break; case SP_ATTR_TYPE: - read_int = sp_feTurbulence_read_type(value); - if (read_int != feTurbulence->type){ - feTurbulence->type = read_int; + read_type = sp_feTurbulence_read_type(value); + if (read_type != feTurbulence->type){ + feTurbulence->type = read_type; object->parent->requestModified(SP_OBJECT_MODIFIED_FLAG); } break; |
