summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2017-12-26 16:14:27 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2017-12-26 16:14:27 +0000
commitd25de3679d94cc03fdba8aba4de20fab723b4b27 (patch)
treeb5f7a1fea6f2bb2f0d3069916b023ca8b4fa325b /src/ui
parentMerge branch 'master' into powerpencilII (diff)
downloadinkscape-d25de3679d94cc03fdba8aba4de20fab723b4b27.tar.gz
inkscape-d25de3679d94cc03fdba8aba4de20fab723b4b27.zip
Fix power stroke closed path and minor tweacks for pencil powerstroke
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp2
-rw-r--r--src/ui/tools/freehand-base.cpp1
-rw-r--r--src/ui/tools/pencil-tool.cpp9
3 files changed, 8 insertions, 4 deletions
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index eb4a6567e..0ac12d15c 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -432,7 +432,7 @@ void InkscapePreferences::initPageTools()
this->AddDotSizeSpinbutton(_page_pencil, "/tools/freehand/pencil", 3.0);
this->AddBaseSimplifySpinbutton(_page_pencil, "/tools/freehand/pencil", 25.0);
_page_pencil.add_group_header( _("Pressure sensitivity settings"));
- this->AddPencilPowerStrokePressureStep(_page_pencil, "/tools/freehand/pencil", 10);
+ this->AddPencilPowerStrokePressureStep(_page_pencil, "/tools/freehand/pencil", 5);
_page_pencil.add_group_header( _("Sketch mode"));
_page_pencil.add_line( true, "", _pencil_average_all_sketches, "",
diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp
index d2ef1e00d..8a078d510 100644
--- a/src/ui/tools/freehand-base.cpp
+++ b/src/ui/tools/freehand-base.cpp
@@ -884,7 +884,6 @@ static void spdc_flush_white(FreehandBase *dc, SPCurve *gc)
if (!dc->white_item) {
dc->white_item = SP_ITEM(desktop->currentLayer()->appendChildRepr(repr));
}
- std::cout << "lololololo----------------------lololo" << std::endl;
spdc_check_for_and_apply_waiting_LPE(dc, dc->white_item, c, false);
dc->selection->set(dc->white_item);
}
diff --git a/src/ui/tools/pencil-tool.cpp b/src/ui/tools/pencil-tool.cpp
index 8d9981ae2..2f68688a1 100644
--- a/src/ui/tools/pencil-tool.cpp
+++ b/src/ui/tools/pencil-tool.cpp
@@ -771,7 +771,7 @@ PencilTool::addPowerStrokePencil()
{
using namespace Inkscape::LivePathEffect;
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- double step = prefs->getIntLimited("/tools/freehand/pencil/ps-step-pressure",10, 1, 100)/100.0;
+ double step = prefs->getIntLimited("/tools/freehand/pencil/ps-step-pressure",5, 1, 100)/100.0;
double min = prefs->getIntLimited("/tools/freehand/pencil/minpressure", 0, 1, 100) / 100.0;
double max = prefs->getIntLimited("/tools/freehand/pencil/maxpressure", 100, 1, 100) / 100.0;
Geom::Affine transform_coordinate = SP_ITEM(SP_ACTIVE_DESKTOP->currentLayer())->i2dt_affine();
@@ -790,11 +790,16 @@ PencilTool::addPowerStrokePencil()
double dezoomify_factor = 0.05 * 1000/SP_EVENT_CONTEXT(this)->desktop->current_zoom();//\/100 we want 100% = 1;
double last_pressure = this->_wps.back();
double pressure_shrunk = (last_pressure * (max - min)) + min;
+ step = (step * (max - min)) + min;
//We need half width for power stroke
double pressure_computed = pressure_shrunk * dezoomify_factor/2.0;
this->_last_point = this->ps.back();
this->_last_point *= transform_coordinate.inverse();
- if (this->ps.size() == 1 || std::abs(_previous_pressure - pressure_shrunk) > step ) {
+ if (this->ps.size() == 1 ||
+ std::abs(_previous_pressure - pressure_shrunk) > step ||
+ _previous_pressure == 0.0 ||
+ (_previous_pressure > step && pressure_shrunk < step))
+ {
_previous_pressure = pressure_shrunk;
this->points.push_back(Geom::Point(0, pressure_computed));
this->_points_pos.push_back(this->_last_point);