diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2015-03-07 23:13:15 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2015-03-07 23:13:15 +0000 |
| commit | 2a0d24e61c826a9bf33cad4c8f6769d52d433b43 (patch) | |
| tree | 48f0ecf1ac794fc6f69bb87d0311214ead781c53 /src/ui/tools/pencil-tool.cpp | |
| parent | Improved popup mesage to a LPE Simplify parameter (diff) | |
| download | inkscape-2a0d24e61c826a9bf33cad4c8f6769d52d433b43.tar.gz inkscape-2a0d24e61c826a9bf33cad4c8f6769d52d433b43.zip | |
add interactive smooth to pen tool
(bzr r13973.1.1)
Diffstat (limited to 'src/ui/tools/pencil-tool.cpp')
| -rw-r--r-- | src/ui/tools/pencil-tool.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/ui/tools/pencil-tool.cpp b/src/ui/tools/pencil-tool.cpp index db24c7432..e30bb3a7a 100644 --- a/src/ui/tools/pencil-tool.cpp +++ b/src/ui/tools/pencil-tool.cpp @@ -637,8 +637,11 @@ void PencilTool::_interpolate() { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); double const tol = prefs->getDoubleLimited("/tools/freehand/pencil/tolerance", 10.0, 1.0, 100.0) * 0.4; - double const tolerance_sq = 0.02 * square(this->desktop->w2d().descrim() * tol) * exp(0.2 * tol - 2); - + double tolerance_sq = 0.02 * square(this->desktop->w2d().descrim() * tol) * exp(0.2 * tol - 2); + bool simplify = prefs->getInt("/tools/freehand/pencil/simplify", 0); + if(simplify){ + tolerance_sq = 0; + } g_assert(is_zero(this->req_tangent) || is_unit_vector(this->req_tangent)); this->green_curve->reset(); @@ -705,8 +708,11 @@ void PencilTool::_sketchInterpolate() { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); double const tol = prefs->getDoubleLimited("/tools/freehand/pencil/tolerance", 10.0, 1.0, 100.0) * 0.4; - double const tolerance_sq = 0.02 * square(this->desktop->w2d().descrim() * tol) * exp(0.2 * tol - 2); - + double tolerance_sq = 0.02 * square(this->desktop->w2d().descrim() * tol) * exp(0.2 * tol - 2); + bool simplify = prefs->getInt("/tools/freehand/pencil/simplify", 0); + if(simplify){ + tolerance_sq = 0; + } bool average_all_sketches = prefs->getBool("/tools/freehand/pencil/average_all_sketches", true); g_assert(is_zero(this->req_tangent) || is_unit_vector(this->req_tangent)); |
