From: buliabyak Date: Sat, 14 Apr 2007 17:07:27 +0000 (+0000) Subject: make sure thinning uses updated pressure; make the response a bit nonlinear X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ce15d9fa523c759beb14666a721e51ba8d39ebe5;p=inkscape.git make sure thinning uses updated pressure; make the response a bit nonlinear --- 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, _("Drawing a calligraphic stroke")); } - sp_dyna_draw_extinput(dc, event); if (!sp_dyna_draw_apply(dc, motion_dt)) { ret = TRUE; break;