summaryrefslogtreecommitdiffstats
path: root/src/pencil-context.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-12-22 15:30:36 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-12-22 15:30:36 +0000
commit416564ca2a6ea0cadfc8af0493e51ae0ab01192a (patch)
treeeddcd12a09152ac729182c719c34ee659978b3d8 /src/pencil-context.cpp
parentconvert LINE entity to LWPOLYLINE (diff)
downloadinkscape-416564ca2a6ea0cadfc8af0493e51ae0ab01192a.tar.gz
inkscape-416564ca2a6ea0cadfc8af0493e51ae0ab01192a.zip
fix crash bug 310206
(bzr r7022)
Diffstat (limited to 'src/pencil-context.cpp')
-rw-r--r--src/pencil-context.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/pencil-context.cpp b/src/pencil-context.cpp
index 52e78e71c..56a479f38 100644
--- a/src/pencil-context.cpp
+++ b/src/pencil-context.cpp
@@ -455,17 +455,13 @@ pencil_handle_button_release(SPPencilContext *const pc, GdkEventButton const &re
case SP_PENCIL_CONTEXT_FREEHAND:
if (revent.state & GDK_MOD1_MASK) {
/* sketch mode: interpolate the sketched path and improve the current output path with the new interpolation. don't finish sketch */
- if (anchor) {
- p = anchor->dp;
- }
- pc->ea = anchor;
+
+ sketch_interpolate(pc);
if (pc->green_anchor) {
pc->green_anchor = sp_draw_anchor_destroy(pc->green_anchor);
}
- sketch_interpolate(pc);
-
pc->state = SP_PENCIL_CONTEXT_SKETCH;
} else {
/* Finish segment now */
@@ -486,6 +482,8 @@ pencil_handle_button_release(SPPencilContext *const pc, GdkEventButton const &re
pc->green_anchor = sp_draw_anchor_destroy(pc->green_anchor);
}
pc->state = SP_PENCIL_CONTEXT_IDLE;
+ // reset sketch mode too
+ pc->sketch_n = 0;
}
ret = TRUE;
break;
@@ -826,8 +824,10 @@ sketch_interpolate(SPPencilContext *pc)
} else {
t = 0.5;
}
+ pc->sketch_interpolation = Geom::lerp(fit_pwd2, pc->sketch_interpolation, t);
+ } else {
+ pc->sketch_interpolation = fit_pwd2;
}
- pc->sketch_interpolation = Geom::lerp(fit_pwd2, pc->sketch_interpolation, t);
pc->sketch_n++;
pc->green_curve->reset();