From: cilix42 Date: Mon, 18 Aug 2008 00:47:52 +0000 (+0000) Subject: Add function to cancel wait-for-LPE mode in pen context X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4dd053c1e236163ab0f7a86b6bac3cf3072f6a31;p=inkscape.git Add function to cancel wait-for-LPE mode in pen context --- diff --git a/src/pen-context.cpp b/src/pen-context.cpp index b575e94f3..b7182ac51 100644 --- a/src/pen-context.cpp +++ b/src/pen-context.cpp @@ -1396,6 +1396,17 @@ sp_pen_context_wait_for_LPE_mouse_clicks(SPPenContext *pc, Inkscape::LivePathEff pc->polylines_paraxial = false; // TODO: think if this is correct for all cases } +void +sp_pen_context_cancel_waiting_for_LPE(SPPenContext *pc) +{ + g_print ("Cancelled waiting for mouse clicks for %s\n", + Inkscape::LivePathEffect::LPETypeConverter.get_label(pc->waiting_LPE_type).c_str()); + + pc->waiting_LPE_type = Inkscape::LivePathEffect::INVALID_LPE; + pc->expecting_clicks_for_LPE = 0; + sp_pen_context_set_polyline_mode(pc); +} + static int pen_next_paraxial_direction(const SPPenContext *const pc, NR::Point const &pt, NR::Point const &origin, guint state) { /* diff --git a/src/pen-context.h b/src/pen-context.h index a358126ac..1c84ee2da 100644 --- a/src/pen-context.h +++ b/src/pen-context.h @@ -66,6 +66,7 @@ inline bool sp_pen_context_has_waiting_LPE(SPPenContext *pc) { void sp_pen_context_set_polyline_mode(SPPenContext *const pc); void sp_pen_context_wait_for_LPE_mouse_clicks(SPPenContext *pc, Inkscape::LivePathEffect::EffectType effect_type, unsigned int num_clicks, bool use_polylines = true); +void sp_pen_context_cancel_waiting_for_LPE(SPPenContext *pc); void sp_pen_context_put_into_waiting_mode(SPDesktop *desktop, Inkscape::LivePathEffect::EffectType effect_type, unsigned int num_clicks, bool use_polylines = true);