diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2008-06-02 07:01:30 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2008-06-02 07:01:30 +0000 |
| commit | 78be1b38be3e1e36279cfbc803778b77af9eb908 (patch) | |
| tree | 7ce985afcc71cd9741a69a38cfb7d17c24786bf0 /src/eraser-context.cpp | |
| parent | Corrected broken XML for size pref. (diff) | |
| download | inkscape-78be1b38be3e1e36279cfbc803778b77af9eb908.tar.gz inkscape-78be1b38be3e1e36279cfbc803778b77af9eb908.zip | |
Pass through more calls to parent contexts, and added more common property handling.
Fixes bug #236667 and issues with middle-drag and ctrl-arrow.
(bzr r5780)
Diffstat (limited to 'src/eraser-context.cpp')
| -rw-r--r-- | src/eraser-context.cpp | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/src/eraser-context.cpp b/src/eraser-context.cpp index 1920baed5..88496b065 100644 --- a/src/eraser-context.cpp +++ b/src/eraser-context.cpp @@ -218,40 +218,10 @@ static ProfileFloatElement f_profile[PROFILE_FLOAT_SIZE] = { static void sp_eraser_context_set(SPEventContext *ec, gchar const *key, gchar const *val) { - SPEraserContext *erc = SP_ERASER_CONTEXT(ec); - - if (!strcmp(key, "mass")) { - double const dval = ( val ? g_ascii_strtod (val, NULL) : 0.2 ); - erc->mass = CLAMP(dval, -1000.0, 1000.0); - } else if (!strcmp(key, "wiggle")) { - double const dval = ( val ? g_ascii_strtod (val, NULL) : (1 - DRAG_DEFAULT)); - erc->drag = CLAMP((1 - dval), DRAG_MIN, DRAG_MAX); // drag is inverse to wiggle - } else if (!strcmp(key, "angle")) { - double const dval = ( val ? g_ascii_strtod (val, NULL) : 0.0); - erc->angle = CLAMP (dval, -90, 90); - } else if (!strcmp(key, "width")) { - double const dval = ( val ? g_ascii_strtod (val, NULL) : 0.1 ); - erc->width = CLAMP(dval, -1000.0, 1000.0); - } else if (!strcmp(key, "thinning")) { - double const dval = ( val ? g_ascii_strtod (val, NULL) : 0.1 ); - erc->vel_thin = CLAMP(dval, -1.0, 1.0); - } else if (!strcmp(key, "tremor")) { - double const dval = ( val ? g_ascii_strtod (val, NULL) : 0.0 ); - erc->tremor = CLAMP(dval, 0.0, 1.0); - } else if (!strcmp(key, "flatness")) { - double const dval = ( val ? g_ascii_strtod (val, NULL) : 1.0 ); - erc->flatness = CLAMP(dval, 0, 1.0); - } else if (!strcmp(key, "usepressure")) { - erc->usepressure = (val && strcmp(val, "0")); - } else if (!strcmp(key, "usetilt")) { - erc->usetilt = (val && strcmp(val, "0")); - } else if (!strcmp(key, "abs_width")) { - erc->abs_width = (val && strcmp(val, "0")); - } else if (!strcmp(key, "cap_rounding")) { - erc->cap_rounding = ( val ? g_ascii_strtod (val, NULL) : 0.0 ); + //pass on up to parent class to handle common attributes. + if ( eraser_parent_class->set ) { + eraser_parent_class->set(ec, key, val); } - - //g_print("ERC: %g %g %g %g\n", erc->mass, erc->drag, erc->angle, erc->width); } static double |
