diff options
| author | bulia byak <buliabyak@gmail.com> | 2007-04-23 20:27:52 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2007-04-23 20:27:52 +0000 |
| commit | 68b76c862f0133fccb126584757035a6766deded (patch) | |
| tree | 7d49de3c3d373898207d8536d90ac058153181bf /src/pen-context.cpp | |
| parent | Fix for bug #1699198: snap nodes of clones (diff) | |
| download | inkscape-68b76c862f0133fccb126584757035a6766deded.tar.gz inkscape-68b76c862f0133fccb126584757035a6766deded.zip | |
fix 1704038: finishing on right-click assumed we are finishing unclosed, which is not always true
(bzr r2952)
Diffstat (limited to 'src/pen-context.cpp')
| -rw-r--r-- | src/pen-context.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/pen-context.cpp b/src/pen-context.cpp index ac4a8accb..5a60a7b52 100644 --- a/src/pen-context.cpp +++ b/src/pen-context.cpp @@ -340,24 +340,24 @@ static gint pen_handle_button_press(SPPenContext *const pc, GdkEventButton const return FALSE; } + SPDrawContext * const dc = SP_DRAW_CONTEXT(pc); + SPDesktop * const desktop = SP_EVENT_CONTEXT_DESKTOP(dc); + NR::Point const event_w(bevent.x, bevent.y); + NR::Point const event_dt(desktop->w2d(event_w)); + gint ret = FALSE; if (bevent.button == 1) { - SPDrawContext * const dc = SP_DRAW_CONTEXT(pc); - SPDesktop * const desktop = SP_EVENT_CONTEXT_DESKTOP(dc); - if (Inkscape::have_viable_layer(desktop, dc->_message_context) == false) { return TRUE; } - NR::Point const event_w(bevent.x, bevent.y); pen_drag_origin_w = event_w; pen_within_tolerance = true; /* Test whether we hit any anchor. */ SPDrawAnchor * const anchor = spdc_test_inside(pc, event_w); - NR::Point const event_dt(desktop->w2d(event_w)); switch (pc->mode) { case SP_PEN_CONTEXT_MODE_CLICK: /* In click mode we add point on release */ @@ -458,7 +458,16 @@ static gint pen_handle_button_press(SPPenContext *const pc, GdkEventButton const } } else if (bevent.button == 3) { if (pc->npoints != 0) { - spdc_pen_finish(pc, FALSE); + + spdc_pen_finish_segment(pc, event_dt, bevent.state); + if (pc->green_closed) { + // finishing at the start anchor, close curve + spdc_pen_finish(pc, TRUE); + } else { + // finishing at some other anchor, finish curve but not close + spdc_pen_finish(pc, FALSE); + } + ret = TRUE; } } |
