summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2019-07-14 18:45:05 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2019-07-14 18:45:05 +0000
commit97ee076dc10e2f8e8d4f097cbb6b4d3c5b6a5c84 (patch)
treeaaded3374d246b7939c0db3ac62c900ed9644f95 /src
parentremove some comments and a warning (diff)
downloadinkscape-97ee076dc10e2f8e8d4f097cbb6b4d3c5b6a5c84.tar.gz
inkscape-97ee076dc10e2f8e8d4f097cbb6b4d3c5b6a5c84.zip
fixing coding style
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/lpe-powerstroke.cpp37
-rw-r--r--src/ui/toolbar/pencil-toolbar.cpp21
-rw-r--r--src/ui/toolbar/pencil-toolbar.h2
-rw-r--r--src/ui/tools/freehand-base.cpp45
-rw-r--r--src/ui/tools/pencil-tool.cpp77
-rw-r--r--src/ui/tools/pencil-tool.h2
6 files changed, 89 insertions, 95 deletions
diff --git a/src/live_effects/lpe-powerstroke.cpp b/src/live_effects/lpe-powerstroke.cpp
index 15fda42fc..e7700ba78 100644
--- a/src/live_effects/lpe-powerstroke.cpp
+++ b/src/live_effects/lpe-powerstroke.cpp
@@ -208,36 +208,37 @@ LPEPowerStroke::doBeforeEffect(SPLPEItem const *lpeItem)
offset_points.set_scale_width(scale_width);
}
-void
-LPEPowerStroke::applyStyle(SPLPEItem *lpeitem)
+void LPEPowerStroke::applyStyle(SPLPEItem *lpeitem)
{
- SPCSSAttr *css = sp_repr_css_attr_new ();
+ SPCSSAttr *css = sp_repr_css_attr_new();
if (lpeitem->style) {
if (lpeitem->style->stroke.isPaintserver()) {
- SPPaintServer * server = lpeitem->style->getStrokePaintServer();
+ SPPaintServer *server = lpeitem->style->getStrokePaintServer();
if (server) {
Glib::ustring str;
str += "url(#";
str += server->getId();
str += ")";
- sp_repr_css_set_property (css, "fill", str.c_str());
+ sp_repr_css_set_property(css, "fill", str.c_str());
}
} else if (lpeitem->style->stroke.isColor()) {
gchar c[64];
- sp_svg_write_color (c, sizeof(c), lpeitem->style->stroke.value.color.toRGBA32(SP_SCALE24_TO_FLOAT(lpeitem->style->stroke_opacity.value)));
- sp_repr_css_set_property (css, "fill", c);
+ sp_svg_write_color(
+ c, sizeof(c),
+ lpeitem->style->stroke.value.color.toRGBA32(SP_SCALE24_TO_FLOAT(lpeitem->style->stroke_opacity.value)));
+ sp_repr_css_set_property(css, "fill", c);
} else {
- sp_repr_css_set_property (css, "fill", "none");
+ sp_repr_css_set_property(css, "fill", "none");
}
} else {
- sp_repr_css_unset_property (css, "fill");
+ sp_repr_css_unset_property(css, "fill");
}
- sp_repr_css_set_property(css, "fill-rule", "nonzero");
+ sp_repr_css_set_property(css, "fill-rule", "nonzero");
sp_repr_css_set_property(css, "stroke", "none");
-
+
sp_desktop_apply_css_recursive(lpeitem, css, true);
- sp_repr_css_attr_unref (css);
+ sp_repr_css_attr_unref(css);
}
void
@@ -256,17 +257,17 @@ LPEPowerStroke::doOnApply(SPLPEItem const* lpeitem)
item->updateRepr();
if (pathv.empty()) {
points.emplace_back(0.2,width );
- points.emplace_back(0.5,width );
- points.emplace_back(0.8,width );
+ points.emplace_back(0.5, width);
+ points.emplace_back(0.8, width);
} else {
Geom::Path const &path = pathv.front();
Geom::Path::size_type const size = path.size_default();
if (!path.closed()) {
- points.emplace_back(0.2,width );
+ points.emplace_back(0.2, width);
}
- points.emplace_back(0.5*size,width );
+ points.emplace_back(0.5 * size, width);
if (!path.closed()) {
- points.emplace_back(size - 0.2,width );
+ points.emplace_back(size - 0.2, width);
}
}
offset_points.param_set_and_write_new_value(points);
@@ -765,7 +766,7 @@ LPEPowerStroke::doEffect_path (Geom::PathVector const & path_in)
}
if (path_out.empty()) {
return path_in;
- //doEffect_path (path_in);
+ // doEffect_path (path_in);
}
return path_out;
}
diff --git a/src/ui/toolbar/pencil-toolbar.cpp b/src/ui/toolbar/pencil-toolbar.cpp
index 14dbed5a8..688524310 100644
--- a/src/ui/toolbar/pencil-toolbar.cpp
+++ b/src/ui/toolbar/pencil-toolbar.cpp
@@ -107,13 +107,9 @@ PencilToolbar::PencilToolbar(SPDesktop *desktop,
if (pencil_mode) {
/* Use pressure */
{
- _pressure_item = add_toggle_button(_("Use pressure input"),
- _("Use pressure input"));
+ _pressure_item = add_toggle_button(_("Use pressure input"), _("Use pressure input"));
_pressure_item->set_icon_name(INKSCAPE_ICON("draw-use-pressure"));
bool pressure = prefs->getBool(freehand_tool_name() + "/pressure", false);
- if (oldPressureMode && pressure) {
- prefs->setBool(freehand_tool_name() + "/pressure", true);
- }
_pressure_item->set_active(pressure);
_pressure_item->signal_toggled().connect(sigc::mem_fun(*this, &PencilToolbar::use_pencil_pressure));
}
@@ -141,14 +137,16 @@ PencilToolbar::PencilToolbar(SPDesktop *desktop,
{
auto pressurestep_val = prefs->getDouble("/tools/freehand/pencil/pressurestep", 5);
_pressurestep_adj = Gtk::Adjustment::create(pressurestep_val, 0., 100, 1.0, 0.0);
- _pressurestep = Gtk::manage(new UI::Widget::SpinButtonToolItem("pencil-pressurestep", _("Knot gap:"), _pressurestep_adj, 0, 0));
+ _pressurestep = Gtk::manage(
+ new UI::Widget::SpinButtonToolItem("pencil-pressurestep", _("Knot gap:"), _pressurestep_adj, 0, 0));
_pressurestep->set_tooltip_text(_("Pressure steps for new knot"));
_pressurestep->set_focus_widget(Glib::wrap(GTK_WIDGET(desktop->canvas)));
- _pressurestep_adj->signal_value_changed().connect(sigc::mem_fun(*this, &PencilToolbar::pressurestep_value_changed));
+ _pressurestep_adj->signal_value_changed().connect(
+ sigc::mem_fun(*this, &PencilToolbar::pressurestep_value_changed));
add(*_pressurestep);
}
-
+
add(* Gtk::manage(new Gtk::SeparatorToolItem()));
@@ -341,8 +339,7 @@ PencilToolbar::maxpressure_value_changed()
prefs->setDouble( "/tools/freehand/pencil/maxpressure", _maxpressure_adj->get_value());
}
-void
-PencilToolbar::pressurestep_value_changed()
+void PencilToolbar::pressurestep_value_changed()
{
// quit if run by the attr_changed listener
if (_freeze) {
@@ -350,7 +347,7 @@ PencilToolbar::pressurestep_value_changed()
}
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- prefs->setDouble( "/tools/freehand/pencil/pressurestep", _pressurestep_adj->get_value());
+ prefs->setDouble("/tools/freehand/pencil/pressurestep", _pressurestep_adj->get_value());
}
void
@@ -371,7 +368,7 @@ PencilToolbar::use_pencil_pressure() {
}
} else {
guint freehandMode = prefs->getInt("/tools/freehand/pencil/freehand-mode", 0);
-
+
_minpressure->set_visible(false);
_maxpressure->set_visible(false);
_pressurestep->set_visible(false);
diff --git a/src/ui/toolbar/pencil-toolbar.h b/src/ui/toolbar/pencil-toolbar.h
index 81db52595..9022d32da 100644
--- a/src/ui/toolbar/pencil-toolbar.h
+++ b/src/ui/toolbar/pencil-toolbar.h
@@ -54,7 +54,7 @@ private:
UI::Widget::SpinButtonToolItem *_minpressure;
UI::Widget::SpinButtonToolItem *_maxpressure;
UI::Widget::SpinButtonToolItem *_pressurestep;
-
+
XML::Node *_repr;
Gtk::ToolButton *_flatten_spiro_bspline;
Gtk::ToolButton *_flatten_simplify;
diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp
index bc092b79c..556ba9f2b 100644
--- a/src/ui/tools/freehand-base.cpp
+++ b/src/ui/tools/freehand-base.cpp
@@ -31,15 +31,15 @@
#include "live_effects/lpe-simplify.h"
#include "live_effects/lpe-powerstroke.h"
-#include "svg/svg.h"
#include "svg/svg-color.h"
+#include "svg/svg.h"
+#include "id-clash.h"
#include "object/sp-item-group.h"
#include "object/sp-path.h"
#include "object/sp-rect.h"
#include "object/sp-use.h"
#include "style.h"
-#include "id-clash.h"
#include "ui/clipboard.h"
#include "ui/control-manager.h"
@@ -233,38 +233,40 @@ static void spdc_paste_curve_as_freehand_shape(Geom::PathVector const &newpath,
lpe->getRepr()->setAttribute("prop_scale", os.str().c_str());
}
-void
-spdc_apply_style(SPObject *obj)
+void spdc_apply_style(SPObject *obj)
{
- SPCSSAttr *css = sp_repr_css_attr_new ();
+ SPCSSAttr *css = sp_repr_css_attr_new();
if (obj->style) {
if (obj->style->stroke.isPaintserver()) {
- SPPaintServer * server = obj->style->getStrokePaintServer();
+ SPPaintServer *server = obj->style->getStrokePaintServer();
if (server) {
Glib::ustring str;
str += "url(#";
str += server->getId();
str += ")";
- sp_repr_css_set_property (css, "fill", str.c_str());
+ sp_repr_css_set_property(css, "fill", str.c_str());
}
} else if (obj->style->stroke.isColor()) {
gchar c[64];
- sp_svg_write_color (c, sizeof(c), obj->style->stroke.value.color.toRGBA32(SP_SCALE24_TO_FLOAT(obj->style->stroke_opacity.value)));
- sp_repr_css_set_property (css, "fill", c);
+ sp_svg_write_color(
+ c, sizeof(c),
+ obj->style->stroke.value.color.toRGBA32(SP_SCALE24_TO_FLOAT(obj->style->stroke_opacity.value)));
+ sp_repr_css_set_property(css, "fill", c);
} else {
- sp_repr_css_set_property (css, "fill", "none");
+ sp_repr_css_set_property(css, "fill", "none");
}
} else {
- sp_repr_css_unset_property (css, "fill");
+ sp_repr_css_unset_property(css, "fill");
}
- sp_repr_css_set_property(css, "fill-rule", "nonzero");
+ sp_repr_css_set_property(css, "fill-rule", "nonzero");
sp_repr_css_set_property(css, "stroke", "none");
-
+
sp_desktop_apply_css_recursive(obj, css, true);
- sp_repr_css_attr_unref (css);
+ sp_repr_css_attr_unref(css);
}
-static void spdc_apply_powerstroke_shape(std::vector<Geom::Point> points, FreehandBase *dc, SPItem *item, gint maxrecursion = 0)
+static void spdc_apply_powerstroke_shape(std::vector<Geom::Point> points, FreehandBase *dc, SPItem *item,
+ gint maxrecursion = 0)
{
using namespace Inkscape::LivePathEffect;
@@ -282,7 +284,8 @@ static void spdc_apply_powerstroke_shape(std::vector<Geom::Point> points, Freeha
if (SP_SHAPE(elemref)->getCurve() != pt->curvepressure) {
elemref->getRepr()->setAttribute("style", nullptr);
SPItem *successor = dynamic_cast<SPItem *>(elemref);
- sp_desktop_apply_style_tool(desktop, successor->getRepr(), Glib::ustring("/tools/freehand/pencil").data(), false);
+ sp_desktop_apply_style_tool(desktop, successor->getRepr(),
+ Glib::ustring("/tools/freehand/pencil").data(), false);
spdc_apply_style(successor);
item->deleteObject(true);
item = successor;
@@ -291,10 +294,10 @@ static void spdc_apply_powerstroke_shape(std::vector<Geom::Point> points, Freeha
rename_id(SP_OBJECT(item), "path-1");
} else {
using namespace Inkscape::LivePathEffect;
- Effect* lpe = SP_LPE_ITEM(elemref)->getCurrentLPE();
+ Effect *lpe = SP_LPE_ITEM(elemref)->getCurrentLPE();
if (lpe) {
SP_LPE_ITEM(elemref)->removeCurrentPathEffect(true);
- LivePathEffectObject * lpeobj = lpe->getLPEObj();
+ LivePathEffectObject *lpeobj = lpe->getLPEObj();
if (lpeobj) {
SP_OBJECT(lpeobj)->deleteObject(true);
lpeobj = nullptr;
@@ -302,14 +305,14 @@ static void spdc_apply_powerstroke_shape(std::vector<Geom::Point> points, Freeha
}
elemref->deleteObject(true);
elemref = nullptr;
- maxrecursion ++;
+ maxrecursion++;
if (maxrecursion < 5) {
pt->addPowerStrokePencil(true);
spdc_apply_powerstroke_shape(points, dc, item, maxrecursion);
}
}
} else {
- maxrecursion ++;
+ maxrecursion++;
if (maxrecursion < 5) {
pt->addPowerStrokePencil(true);
spdc_apply_powerstroke_shape(points, dc, item, maxrecursion);
@@ -453,7 +456,7 @@ static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item,
previous_shape_type = NONE;
}
}
-
+
#define SHAPE_LENGTH 10
#define SHAPE_HEIGHT 10
diff --git a/src/ui/tools/pencil-tool.cpp b/src/ui/tools/pencil-tool.cpp
index a24e6a291..a0dc3201c 100644
--- a/src/ui/tools/pencil-tool.cpp
+++ b/src/ui/tools/pencil-tool.cpp
@@ -19,9 +19,9 @@
#include <gdk/gdkkeysyms.h>
-#include <2geom/sbasis-to-bezier.h>
-#include <2geom/bezier-utils.h>
#include "ui/tools/pencil-tool.h"
+#include <2geom/bezier-utils.h>
+#include <2geom/sbasis-to-bezier.h>
#include <2geom/svg-path-parser.h>
#include "desktop.h"
@@ -42,8 +42,8 @@
#include "live_effects/lpe-powerstroke-interpolators.h"
#include "live_effects/lpe-powerstroke.h"
-#include "object/sp-path.h"
#include "object/sp-lpe-item.h"
+#include "object/sp-path.h"
#include "style.h"
#include "ui/pixmaps/cursor-pencil.xpm"
@@ -481,7 +481,7 @@ bool PencilTool::_handleButtonRelease(GdkEventButton const &revent) {
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
tablet_enabled = prefs->getBool("/tools/freehand/pencil/pressure", false);
if (tablet_enabled) {
- gint prevmode = prefs->getInt("/tools/freehand/pencil/freehand-mode", 0);
+ gint prevmode = prefs->getInt("/tools/freehand/pencil/freehand-mode", 0);
prefs->setInt("/tools/freehand/pencil/freehand-mode", 0);
spdc_concat_colors_and_flush(this, FALSE);
prefs->setInt("/tools/freehand/pencil/freehand-mode", prevmode);
@@ -699,14 +699,9 @@ void PencilTool::_finishEndpoint() {
}
}
-static inline double
-square(double const x)
-{
- return x * x;
-}
+static inline double square(double const x) { return x * x; }
-void
-PencilTool::addPowerStrokePencil(bool force)
+void PencilTool::addPowerStrokePencil(bool force)
{
static int pscounter = 11;
if (pscounter > 10 || force) {
@@ -717,8 +712,8 @@ PencilTool::addPowerStrokePencil(bool force)
}
using namespace Inkscape::LivePathEffect;
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- double min = prefs->getIntLimited("/tools/freehand/pencil/minpressure", 10, 1, 100) / 100.0;
- double max = prefs->getIntLimited("/tools/freehand/pencil/maxpressure", 40, 1, 100) / 100.0;
+ double min = prefs->getIntLimited("/tools/freehand/pencil/minpressure", 10, 1, 100) / 100.0;
+ double max = prefs->getIntLimited("/tools/freehand/pencil/maxpressure", 40, 1, 100) / 100.0;
Geom::Affine transform_coordinate = SP_ITEM(SP_ACTIVE_DESKTOP->currentLayer())->i2dt_affine();
if (min > max){
min = max;
@@ -727,7 +722,7 @@ PencilTool::addPowerStrokePencil(bool force)
double last_pressure = this->_wps.back();
double pressure_shrunk = (last_pressure * (max - min)) + min;
//We need half width for power stroke
- double pressure_computed = (pressure_shrunk * dezoomify_factor)/5.0;
+ double pressure_computed = (pressure_shrunk * dezoomify_factor) / 5.0;
this->_last_point = this->ps.back();
this->_last_point *= transform_coordinate.inverse();
this->_points_pressure.push_back(Geom::Point(0, pressure_computed));
@@ -752,7 +747,7 @@ PencilTool::addPowerStrokePencil(bool force)
if (nofuture || status == std::future_status::ready) {
if (!stop && status == std::future_status::ready) { */
- SPDocument * document = SP_ACTIVE_DOCUMENT;
+ SPDocument *document = SP_ACTIVE_DOCUMENT;
if (!document) {
return;
}
@@ -760,7 +755,7 @@ PencilTool::addPowerStrokePencil(bool force)
SPObject *toremove = document->getObjectById(id);
using namespace Inkscape::LivePathEffect;
if (toremove) {
- toremove->getRepr()->setAttribute("id","tmp_power_stroke_preview");
+ toremove->getRepr()->setAttribute("id", "tmp_power_stroke_preview");
}
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
double tol = prefs->getDoubleLimited("/tools/freehand/pencil/base-simplify", 25.0, 1.0, 100.0) * 0.4;
@@ -787,8 +782,8 @@ PencilTool::addPowerStrokePencil(bool force)
size = Geom::L2(Geom::bounds_fast(original_pathv)->dimensions());
//size /= sp_lpe_item->i2doc_affine().descrim();
pathliv->ConvertEvenLines(tol * size);
- pathliv->Simplify(tol * size);
-
+ pathliv->Simplify(tol * size);
+
Geom::Path path = Geom::parse_svg_path(pathliv->svg_dump_path())[0];*/
if (!path.empty()) {
Geom::Affine transform_coordinate = SP_ITEM(SP_ACTIVE_DESKTOP->currentLayer())->i2dt_affine().inverse();
@@ -797,7 +792,7 @@ PencilTool::addPowerStrokePencil(bool force)
// points_preview.push_back(Geom::Point(path.size() - 1, points_preview[points_preview.size()-1][Geom::Y]));
// future = std::async(std::launch::async, [path, points_preview] {
using namespace Inkscape::LivePathEffect;
- SPDocument * document = SP_ACTIVE_DOCUMENT;
+ SPDocument *document = SP_ACTIVE_DOCUMENT;
if (!document) {
return;
// return true;
@@ -806,14 +801,14 @@ PencilTool::addPowerStrokePencil(bool force)
Inkscape::XML::Node *pp = nullptr;
pp = xml_doc->createElement("svg:path");
pp->setAttribute("sodipodi:insensitive", "true");
- gchar * pvector_str = sp_svg_write_path(path);
+ gchar *pvector_str = sp_svg_write_path(path);
if (pvector_str) {
- pp->setAttribute("d" , pvector_str);
+ pp->setAttribute("d", pvector_str);
g_free(pvector_str);
}
pp->setAttribute("id", "power_stroke_preview");
Inkscape::GC::release(pp);
-
+
SPShape *powerpreview = SP_SHAPE(SP_ITEM(SP_ACTIVE_DESKTOP->currentLayer())->appendChildRepr(pp));
SPLPEItem *lpeitem = dynamic_cast<SPLPEItem *>(powerpreview);
if (!lpeitem) {
@@ -821,15 +816,15 @@ PencilTool::addPowerStrokePencil(bool force)
// return true;
}
tol = prefs->getDoubleLimited("/tools/freehand/pencil/tolerance", 10.0, 1.0, 100.0);
- tol = tol/(100.0*(102.0-tol));
+ tol = tol / (100.0 * (102.0 - tol));
std::ostringstream threshold;
threshold << tol;
Effect::createAndApply(SIMPLIFY, desktop->doc(), SP_ITEM(lpeitem));
- Effect* lpe = lpeitem->getCurrentLPE();
+ Effect *lpe = lpeitem->getCurrentLPE();
if (lpe) {
Glib::ustring pref_path = "/live_effects/simplify/smooth_angles";
bool valid = prefs->getEntry(pref_path).isValid();
- if (!valid){
+ if (!valid) {
lpe->getRepr()->setAttribute("smooth_angles", "360");
}
lpe->getRepr()->setAttribute("threshold", threshold.str());
@@ -847,12 +842,12 @@ PencilTool::addPowerStrokePencil(bool force)
prefs->setBool(pref_path_pp, true);
Effect::createAndApply(POWERSTROKE, SP_ACTIVE_DESKTOP->doc(), lpeitem);
lpe = lpeitem->getCurrentLPE();
- Inkscape::LivePathEffect::LPEPowerStroke *pspreview = static_cast<LPEPowerStroke*>(lpe);
+ Inkscape::LivePathEffect::LPEPowerStroke *pspreview = static_cast<LPEPowerStroke *>(lpe);
sp_lpe_item_enable_path_effects(lpeitem, false);
if (pspreview) {
Glib::ustring pref_path = "/live_effects/powerstroke/interpolator_type";
bool valid = prefs->getEntry(pref_path).isValid();
- if (!valid){
+ if (!valid) {
pspreview->getRepr()->setAttribute("interpolator_type", "CentripetalCatmullRom");
}
pspreview->getRepr()->setAttribute("sort_points", "true");
@@ -860,17 +855,17 @@ PencilTool::addPowerStrokePencil(bool force)
if (powerpreview->getCurve() != curvepressure) {
pp->setAttribute("style", "fill:#888888;opacity:1;fill-rule:nonzero;stroke:none;");
} else if (toremove) {
- toremove->getRepr()->setAttribute("id","power_stroke_preview");
+ toremove->getRepr()->setAttribute("id", "power_stroke_preview");
toremove = powerpreview;
}
}
sp_lpe_item_enable_path_effects(lpeitem, true);
-
+
if (toremove) {
using namespace Inkscape::LivePathEffect;
- Effect* lpe = SP_LPE_ITEM(toremove)->getCurrentLPE();
+ Effect *lpe = SP_LPE_ITEM(toremove)->getCurrentLPE();
SP_LPE_ITEM(toremove)->removeCurrentPathEffect(true);
- LivePathEffectObject * lpeobj = lpe->getLPEObj();
+ LivePathEffectObject *lpeobj = lpe->getLPEObj();
if (lpeobj) {
SP_OBJECT(lpeobj)->deleteObject(true);
lpeobj = nullptr;
@@ -896,7 +891,7 @@ PencilTool::addPowerStrokePencil(bool force)
void PencilTool::_addFreehandPoint(Geom::Point const &p, guint /*state*/) {
g_assert( this->_npoints > 0 );
g_return_if_fail(unsigned(this->_npoints) < G_N_ELEMENTS(this->p));
-
+
if ( ( p != this->p[ this->_npoints - 1 ] )
&& in_svg_plane(p) )
{
@@ -915,8 +910,8 @@ void PencilTool::_addFreehandPoint(Geom::Point const &p, guint /*state*/) {
}
}
-void
-PencilTool::powerStrokeInterpolate(Geom::Path path) {
+void PencilTool::powerStrokeInterpolate(Geom::Path path)
+{
size_t ps_size = this->ps.size();
if ( ps_size <= 1 ) {
return;
@@ -925,9 +920,9 @@ PencilTool::powerStrokeInterpolate(Geom::Path path) {
using Geom::Y;
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
double step = prefs->getDoubleLimited("/tools/freehand/pencil/pressurestep", 5.0, 0.0, 100.0);
- double min = prefs->getIntLimited("/tools/freehand/pencil/minpressure", 10, 1, 100) / 100.0;
- double max = prefs->getIntLimited("/tools/freehand/pencil/maxpressure", 40, 1, 100) / 100.0;
- if (min > max){
+ double min = prefs->getIntLimited("/tools/freehand/pencil/minpressure", 10, 1, 100) / 100.0;
+ double max = prefs->getIntLimited("/tools/freehand/pencil/maxpressure", 40, 1, 100) / 100.0;
+ if (min > max) {
min = max;
}
step = (step * (max - min)) + min;
@@ -937,14 +932,12 @@ PencilTool::powerStrokeInterpolate(Geom::Path path) {
std::vector<Geom::Point> tmp_points_pos;
Geom::Point prev = Geom::Point(Geom::infinity(), Geom::infinity());
size_t i = 0;
- for (auto pospoint: this->_points_pos) {
+ for (auto pospoint : this->_points_pos) {
Geom::Point pp = pospoint;
- pp[Geom::X] = (path.size()/(double)this->_points_pos.size()) * i;
+ pp[Geom::X] = (path.size() / (double)this->_points_pos.size()) * i;
pp[Geom::Y] = this->_points_pressure[i][Geom::Y];
if (this->_points_pos.size() - 1 == i ||
- (!Geom::are_near(prev[Geom::X], pp[Geom::X], 0.2) &&
- !Geom::are_near(prev[Geom::Y], pp[Geom::Y], step)))
- {
+ (!Geom::are_near(prev[Geom::X], pp[Geom::X], 0.2) && !Geom::are_near(prev[Geom::Y], pp[Geom::Y], step))) {
tmp_points.push_back(pp);
prev = pp;
}
diff --git a/src/ui/tools/pencil-tool.h b/src/ui/tools/pencil-tool.h
index a4c9cbe39..211d21a1a 100644
--- a/src/ui/tools/pencil-tool.h
+++ b/src/ui/tools/pencil-tool.h
@@ -53,7 +53,7 @@ public:
Geom::Piecewise<Geom::D2<Geom::SBasis> > sketch_interpolation; // the current proposal from the sketched paths
unsigned sketch_n; // number of sketches done
static const std::string prefsPath;
- SPCurve * curvepressure;
+ SPCurve *curvepressure;
const std::string& getPrefsPath() override;
protected: