Code

Add function to cancel wait-for-LPE mode in pen context
authorcilix42 <cilix42@users.sourceforge.net>
Mon, 18 Aug 2008 00:47:52 +0000 (00:47 +0000)
committercilix42 <cilix42@users.sourceforge.net>
Mon, 18 Aug 2008 00:47:52 +0000 (00:47 +0000)
src/pen-context.cpp
src/pen-context.h

index b575e94f3a97a4a1f0a627a58783190a4f7c4e48..b7182ac513d7d0554feefeedb00d838284086a43 100644 (file)
@@ -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) {
     /*
index a358126acad8e5074d0f636160637c095d96126e..1c84ee2da80fc2f51af399c636acfbe37a9df777 100644 (file)
@@ -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);