diff options
| author | bulia byak <buliabyak@gmail.com> | 2007-04-14 17:07:27 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2007-04-14 17:07:27 +0000 |
| commit | b6fbec9a434849547c63023f50d53b6258c4ba9b (patch) | |
| tree | d59302b7f155b88fcddab1c38e1fab288e86dce4 /src/dyna-draw-context.cpp | |
| parent | Change python binding mechanism (diff) | |
| download | inkscape-b6fbec9a434849547c63023f50d53b6258c4ba9b.tar.gz inkscape-b6fbec9a434849547c63023f50d53b6258c4ba9b.zip | |
make sure thinning uses updated pressure; make the response a bit nonlinear
(bzr r2886)
Diffstat (limited to 'src/dyna-draw-context.cpp')
| -rw-r--r-- | src/dyna-draw-context.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/dyna-draw-context.cpp b/src/dyna-draw-context.cpp index 6925960ea..3b5e94d28 100644 --- a/src/dyna-draw-context.cpp +++ b/src/dyna-draw-context.cpp @@ -599,7 +599,11 @@ get_dilate_radius (SPDynaDrawContext *dc) double get_dilate_force (SPDynaDrawContext *dc) { - return 8 * dc->pressure/SP_EVENT_CONTEXT(dc)->desktop->current_zoom(); + double force = 4 * dc->pressure/SP_EVENT_CONTEXT(dc)->desktop->current_zoom(); + if (force > 3) { + force += 8 * (force - 3); + } + return force; } bool @@ -614,6 +618,9 @@ sp_ddc_dilate (SPDynaDrawContext *dc, NR::Point p, bool expand) bool did = false; double radius = get_dilate_radius(dc); double offset = get_dilate_force(dc); + if (radius == 0 || offset == 0) { + return false; + } for (GSList *items = g_slist_copy((GSList *) selection->itemList()); items != NULL; @@ -806,6 +813,7 @@ sp_dyna_draw_context_root_handler(SPEventContext *event_context, NR::Point const motion_w(event->motion.x, event->motion.y); NR::Point motion_dt(desktop->w2d(motion_w)); + sp_dyna_draw_extinput(dc, event); // draw the dilating cursor if (event->motion.state & GDK_MOD1_MASK) { @@ -992,7 +1000,6 @@ sp_dyna_draw_context_root_handler(SPEventContext *event_context, dc->_message_context->set(Inkscape::NORMAL_MESSAGE, _("<b>Drawing</b> a calligraphic stroke")); } - sp_dyna_draw_extinput(dc, event); if (!sp_dyna_draw_apply(dc, motion_dt)) { ret = TRUE; break; |
