From 16cf6039cb46b426eb6005ed8e9ae710fa0c9bed Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sun, 4 Sep 2016 11:22:09 +0200 Subject: Fix some chrash when apply LPE: ej- sometimes Gear (bzr r15103) --- src/sp-lpe-item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index 85df070b8..4719f98d0 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -460,7 +460,7 @@ void SPLPEItem::addPathEffect(std::string value, bool reset) if (SP_ACTIVE_DESKTOP ) { Inkscape::UI::Tools::ToolBase *ec = SP_ACTIVE_DESKTOP->event_context; if (INK_IS_NODE_TOOL(ec)) { - tools_switch(SP_ACTIVE_DESKTOP, TOOLS_LPETOOL); //mhh + tools_switch(SP_ACTIVE_DESKTOP, TOOLS_SELECT); //mhh tools_switch(SP_ACTIVE_DESKTOP, TOOLS_NODES); } } -- cgit v1.2.3 From 0711d958cefd7acfa36b8d2f7e556afd95c04941 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sun, 4 Sep 2016 17:28:07 +0200 Subject: Fix bug#744612 Fixed bugs: - https://launchpad.net/bugs/744612 (bzr r15104) --- src/live_effects/lpe-gears.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/live_effects/lpe-gears.cpp b/src/live_effects/lpe-gears.cpp index 307fab6fd..fc5327257 100644 --- a/src/live_effects/lpe-gears.cpp +++ b/src/live_effects/lpe-gears.cpp @@ -248,6 +248,9 @@ LPEGears::doEffect_path (Geom::PathVector const &path_in) path_out.push_back( gear->path()); for (++it; it != gearpath.end() ; ++it) { + if (are_near((*it).initialPoint(), (*it).finalPoint())) { + continue; + } // iterate through Geom::Curve in path_in Gear* gearnew = new Gear(gear->spawn( (*it).finalPoint() )); path_out.push_back( gearnew->path() ); -- cgit v1.2.3 From 707c97e59e42f890e1f70ed8c92614db105cf7e0 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Mon, 5 Sep 2016 08:11:03 +0200 Subject: Bug#744612. Add minimun radius value to minimize hangs Fixed bugs: - https://launchpad.net/bugs/744612 (bzr r15105) --- src/live_effects/lpe-gears.cpp | 17 +++++++++++------ src/live_effects/lpe-gears.h | 1 + 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/live_effects/lpe-gears.cpp b/src/live_effects/lpe-gears.cpp index fc5327257..1d5398aa5 100644 --- a/src/live_effects/lpe-gears.cpp +++ b/src/live_effects/lpe-gears.cpp @@ -207,7 +207,8 @@ namespace LivePathEffect { LPEGears::LPEGears(LivePathEffectObject *lpeobject) : Effect(lpeobject), teeth(_("_Teeth:"), _("The number of teeth"), "teeth", &wr, this, 10), - phi(_("_Phi:"), _("Tooth pressure angle (typically 20-25 deg). The ratio of teeth not in contact."), "phi", &wr, this, 5) + phi(_("_Phi:"), _("Tooth pressure angle (typically 20-25 deg). The ratio of teeth not in contact."), "phi", &wr, this, 5), + min_radius(_("Min Radius:"), _("Minimun radius, low balues can slow"), "min_radius", &wr, this, 5.0) { /* Tooth pressure angle: The angle between the tooth profile and a perpendicular to the pitch * circle, usually at the point where the pitch circle meets the tooth profile. Standard angles @@ -218,8 +219,10 @@ LPEGears::LPEGears(LivePathEffectObject *lpeobject) : teeth.param_make_integer(); teeth.param_set_range(3, 1e10); - registerParameter( dynamic_cast(&teeth) ); - registerParameter( dynamic_cast(&phi) ); + min_radius.param_set_range(0.01, 9999.0); + registerParameter(&teeth); + registerParameter(&phi); + registerParameter(&min_radius); } LPEGears::~LPEGears() @@ -242,11 +245,13 @@ LPEGears::doEffect_path (Geom::PathVector const &path_in) gear->angle(atan2((*it).initialPoint() - gear_centre)); ++it; - if ( it == gearpath.end() ) return path_out; - gear->pitch_radius(Geom::distance(gear_centre, (*it).finalPoint())); + if ( it == gearpath.end() ) return path_out; + double radius = Geom::distance(gear_centre, (*it).finalPoint()); + radius = radius < min_radius?min_radius:radius; + gear->pitch_radius(radius); path_out.push_back( gear->path()); - + for (++it; it != gearpath.end() ; ++it) { if (are_near((*it).initialPoint(), (*it).finalPoint())) { continue; diff --git a/src/live_effects/lpe-gears.h b/src/live_effects/lpe-gears.h index 5dd6dd239..57b49d2b5 100644 --- a/src/live_effects/lpe-gears.h +++ b/src/live_effects/lpe-gears.h @@ -27,6 +27,7 @@ public: private: ScalarParam teeth; ScalarParam phi; + ScalarParam min_radius; LPEGears(const LPEGears&); LPEGears& operator=(const LPEGears&); -- cgit v1.2.3