summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-05-29 19:37:41 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-05-29 19:37:41 +0000
commitf01a7689716bf654bf10638e6e141597c88db8cf (patch)
tree478d4a7b95fc7f2424306e8ed72473be499e83e0 /src
parentAlex Valavanis fix for a compiling bug (diff)
downloadinkscape-f01a7689716bf654bf10638e6e141597c88db8cf.tar.gz
inkscape-f01a7689716bf654bf10638e6e141597c88db8cf.zip
Fix a bug in BSpline whith pencil mode and handles tolerance
(bzr r14187)
Diffstat (limited to 'src')
-rw-r--r--src/ui/tools/pencil-tool.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/ui/tools/pencil-tool.cpp b/src/ui/tools/pencil-tool.cpp
index ba103fa8e..16c26546f 100644
--- a/src/ui/tools/pencil-tool.cpp
+++ b/src/ui/tools/pencil-tool.cpp
@@ -53,6 +53,7 @@ static Geom::Point pencil_drag_origin_w(0, 0);
static bool pencil_within_tolerance = false;
static bool in_svg_plane(Geom::Point const &p) { return Geom::LInfty(p) < 1e18; }
+const double HANDLE_CUBIC_GAP = 0.01;
const std::string& PencilTool::getPrefsPath() {
return PencilTool::prefsPath;
@@ -660,10 +661,10 @@ void PencilTool::_interpolate() {
for (int c = 0; c < n_segs; c++) {
// if we are in BSpline we modify the trace to create adhoc nodes
if(mode == 2){
- Geom::Point point_at1 = b[4*c+0] + (1./3)*(b[4*c+3] - b[4*c+0]);
- point_at1 = Geom::Point(point_at1[X] + 0.0001,point_at1[Y] + 0.0001);
- Geom::Point point_at2 = b[4*c+3] + (1./3)*(b[4*c+0] - b[4*c+3]);
- point_at2 = Geom::Point(point_at2[X] + 0.0001,point_at2[Y] + 0.0001);
+ Geom::Point point_at1 = b[4 * c + 0] + (1./3) * (b[4 * c + 3] - b[4 * c + 0]);
+ point_at1 = Geom::Point(point_at1[X] + HANDLE_CUBIC_GAP, point_at1[Y] + HANDLE_CUBIC_GAP);
+ Geom::Point point_at2 = b[4 * c + 3] + (1./3) * (b[4 * c + 0] - b[4 * c + 3]);
+ point_at2 = Geom::Point(point_at2[X] + HANDLE_CUBIC_GAP, point_at2[Y] + HANDLE_CUBIC_GAP);
this->green_curve->curveto(point_at1,point_at2,b[4*c+3]);
}else{
this->green_curve->curveto(b[4 * c + 1], b[4 * c + 2], b[4 * c + 3]);
@@ -808,9 +809,9 @@ void PencilTool::_fitAndSplit() {
guint mode = prefs->getInt("/tools/freehand/pencil/freehand-mode", 0);
if(mode == 2){
Geom::Point point_at1 = b[0] + (1./3)*(b[3] - b[0]);
- point_at1 = Geom::Point(point_at1[X] + 0.0001,point_at1[Y] + 0.0001);
+ point_at1 = Geom::Point(point_at1[X] + HANDLE_CUBIC_GAP, point_at1[Y] + HANDLE_CUBIC_GAP);
Geom::Point point_at2 = b[3] + (1./3)*(b[0] - b[3]);
- point_at2 = Geom::Point(point_at2[X] + 0.0001,point_at2[Y] + 0.0001);
+ point_at2 = Geom::Point(point_at2[X] + HANDLE_CUBIC_GAP, point_at2[Y] + HANDLE_CUBIC_GAP);
this->red_curve->curveto(point_at1,point_at2,b[3]);
}else{
this->red_curve->curveto(b[1], b[2], b[3]);