From 30dd228b3490bc81b04c6fa3fb36f8c91ceec4e6 Mon Sep 17 00:00:00 2001 From: Maximilian Albert Date: Thu, 12 Jun 2008 13:23:30 +0000 Subject: More infrastructure to have waiting LPEs that are freshly created and applied to yet-to-be-drawn paths (bzr r5903) --- src/pen-context.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/pen-context.cpp') diff --git a/src/pen-context.cpp b/src/pen-context.cpp index 4616c04ae..1091408b3 100644 --- a/src/pen-context.cpp +++ b/src/pen-context.cpp @@ -785,8 +785,14 @@ pen_handle_button_release(SPPenContext *const pc, GdkEventButton const &revent) SPEventContext *ec = SP_EVENT_CONTEXT(pc); Inkscape::Selection *selection = sp_desktop_selection (ec->desktop); - pc->waiting_LPE->acceptParamPath(SP_PATH(selection->singleItem())); - selection->add(SP_OBJECT(pc->waiting_item)); + if (pc->waiting_LPE) { + // we have an already created LPE waiting for a path + pc->waiting_LPE->acceptParamPath(SP_PATH(selection->singleItem())); + selection->add(SP_OBJECT(pc->waiting_item)); + } else { + // the case that we need to create a new LPE and apply it to the just-drawn path is + // handled in spdc_check_for_and_apply_waiting_LPE() in draw-context.cpp + } } } -- cgit v1.2.3