diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2013-03-10 20:34:14 +0000 |
|---|---|---|
| committer | Jabiertxo Arraiza Zenotz <jtx@jtx.marker.es> | 2013-03-10 20:34:14 +0000 |
| commit | 8e034f847b5d49b1ed1aaa0a005da626fdc213da (patch) | |
| tree | bc856333d74b4941858e1ceae4849fad32a608a8 | |
| parent | update to trunk (diff) | |
| download | inkscape-8e034f847b5d49b1ed1aaa0a005da626fdc213da.tar.gz inkscape-8e034f847b5d49b1ed1aaa0a005da626fdc213da.zip | |
Add pencil BSpline mode
(bzr r11950.1.49)
| -rw-r--r-- | src/pencil-context.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pencil-context.cpp b/src/pencil-context.cpp index 5c5780fbb..1ece4528a 100644 --- a/src/pencil-context.cpp +++ b/src/pencil-context.cpp @@ -759,7 +759,9 @@ interpolate(SPPencilContext *pc) for (int c = 0; c < n_segs; c++) { //BSpline if(mode == 2){ - pc->green_curve->lineto(b[4*c+3]); + Geom::Point BP = b[4*c+0] + (1./3)*(b[4*c+3] - b[4*c+0]); + Geom::Point CP = b[4*c+3] + (1./3)*(b[4*c+0] - b[4*c+3]); + pc->green_curve->curveto(BP,CP,b[4*c+3]); }else{ pc->green_curve->curveto(b[4*c+1], b[4*c+2], b[4*c+3]); } @@ -908,7 +910,9 @@ fit_and_split(SPPencilContext *pc) Inkscape::Preferences *prefs = Inkscape::Preferences::get(); guint mode = prefs->getInt("/tools/freehand/pencil/freehand-mode", 0); if(mode == 2){ - pc->red_curve->lineto(b[3]); + Geom::Point B = b[0] + (1./3)*(b[3] - b[0]); + Geom::Point C = b[3] + (1./3)*(b[0] - b[3]); + pc->red_curve->curveto(B,C,b[3]); }else{ pc->red_curve->curveto(b[1], b[2], b[3]); } |
