summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-01-08 00:57:47 +0000
committerJabiertxo Arraiza Cenoz <jtx@jtx.marker.es>2013-01-08 00:57:47 +0000
commiteeb9410c8748a03536119dd01615cda3ca215cb1 (patch)
tree6d959a44f76929ca1419e5d646a58a5bbb1f886f /src
parentUpdate name (diff)
downloadinkscape-eeb9410c8748a03536119dd01615cda3ca215cb1.tar.gz
inkscape-eeb9410c8748a03536119dd01615cda3ca215cb1.zip
Fix BSplines whit 1 segment
(bzr r11950.1.16)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/lpe-bspline.cpp2
-rw-r--r--src/pen-context.cpp8
-rw-r--r--src/pencil-context.cpp9
3 files changed, 10 insertions, 9 deletions
diff --git a/src/live_effects/lpe-bspline.cpp b/src/live_effects/lpe-bspline.cpp
index a57cc9a88..a1f51de0b 100644
--- a/src/live_effects/lpe-bspline.cpp
+++ b/src/live_effects/lpe-bspline.cpp
@@ -43,6 +43,8 @@ LPEBSpline::doEffect(SPCurve * curve)
using Geom::X;
using Geom::Y;
+ if(curve->get_segment_count() < 2)
+ return;
// Make copy of old path as it is changed during processing
Geom::PathVector const original_pathv = curve->get_pathvector();
curve->reset();
diff --git a/src/pen-context.cpp b/src/pen-context.cpp
index 936000c9c..bc57fc603 100644
--- a/src/pen-context.cpp
+++ b/src/pen-context.cpp
@@ -1909,7 +1909,8 @@ static void bspline_doEffect(SPCurve * curve)
{
using Geom::X;
using Geom::Y;
-
+ if(curve->get_segment_count() < 2)
+ return;
// Make copy of old path as it is changed during processing
Geom::PathVector const original_pathv = curve->get_pathvector();
curve->reset();
@@ -2223,11 +2224,6 @@ static void spdc_pen_finish(SPPenContext *const pc, gboolean const closed)
return;
}
- //BSpline
- if(pc->bspline && pc->green_curve->get_segment_count() < 2 && !pc->sa )
- return;
- //BSpline End
-
pc->num_clicks = 0;
pen_disable_events(pc);
diff --git a/src/pencil-context.cpp b/src/pencil-context.cpp
index 4ddeb6a4f..cce04abb7 100644
--- a/src/pencil-context.cpp
+++ b/src/pencil-context.cpp
@@ -779,10 +779,12 @@ interpolate(SPPencilContext *pc)
{
/* Fit and draw and reset state */
pc->green_curve->moveto(b[0]);
+ //BSpline
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ guint mode = prefs->getInt("/tools/freehand/pencil/freehand-mode", 0);
+ //BSpline End
for (int c = 0; c < n_segs; c++) {
- //BSpline
- Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- guint mode = prefs->getInt("/tools/freehand/pencil/freehand-mode", 0);
+ //BSpline
if(mode == 2){
pc->green_curve->lineto(b[4*c+3]);
}else{
@@ -790,6 +792,7 @@ interpolate(SPPencilContext *pc)
}
//BSpline
}
+
sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(pc->red_bpath), pc->green_curve);
/* Fit and draw and copy last point */