From 52c0042e1daeb6645ae4d479b92bae26944c0161 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Tue, 10 Mar 2015 20:20:02 +0100 Subject: This commit remove all ocurrences of Active Desktop casts and all tool swith on Perspective/Envelope and in Lattice 2, also remove some casts from point parameter (bzr r13987) --- src/live_effects/lpe-lattice2.cpp | 6 ------ src/live_effects/lpe-perspective-envelope.cpp | 8 +------- src/live_effects/parameter/point.cpp | 11 ++++------- 3 files changed, 5 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/live_effects/lpe-lattice2.cpp b/src/live_effects/lpe-lattice2.cpp index 1bcbe286f..affa039fa 100644 --- a/src/live_effects/lpe-lattice2.cpp +++ b/src/live_effects/lpe-lattice2.cpp @@ -32,9 +32,6 @@ #include <2geom/d2.h> #include <2geom/piecewise.h> #include <2geom/transforms.h> -#include "ui/tools-switch.h" - -#include "desktop.h" // TODO: should be factored out (see below) using namespace Geom; @@ -396,9 +393,6 @@ LPELattice2::resetGrid() grid_point32x33x34x35.param_set_and_write_default(); //todo:this hack is only to reposition the knots on reser grid button //Better update path effect in LPEITEM - SPDesktop * desktop = SP_ACTIVE_DESKTOP; - tools_switch(desktop, TOOLS_SELECT); - tools_switch(desktop, TOOLS_NODES); } void diff --git a/src/live_effects/lpe-perspective-envelope.cpp b/src/live_effects/lpe-perspective-envelope.cpp index d38427d0a..74c870498 100644 --- a/src/live_effects/lpe-perspective-envelope.cpp +++ b/src/live_effects/lpe-perspective-envelope.cpp @@ -19,9 +19,8 @@ #include "helper/geom.h" #include "display/curve.h" #include "svg/svg.h" -#include "ui/tools-switch.h" #include -#include "desktop.h" + using namespace Geom; @@ -335,11 +334,6 @@ LPEPerspectiveEnvelope::resetGrid() Up_Right_Point.param_set_and_write_default(); Down_Right_Point.param_set_and_write_default(); Down_Left_Point.param_set_and_write_default(); - //todo:this hack is only to reposition the knots on reser grid button - //Better update path effect in LPEITEM - SPDesktop * desktop = SP_ACTIVE_DESKTOP; - tools_switch(desktop, TOOLS_SELECT); - tools_switch(desktop, TOOLS_NODES); } void diff --git a/src/live_effects/parameter/point.cpp b/src/live_effects/parameter/point.cpp index 1d48bda8d..83e7e8f62 100644 --- a/src/live_effects/parameter/point.cpp +++ b/src/live_effects/parameter/point.cpp @@ -113,13 +113,6 @@ void PointParam::param_setValue(Geom::Point newpoint) { *dynamic_cast( this ) = newpoint; - if(SP_ACTIVE_DESKTOP){ - SPDesktop* desktop = SP_ACTIVE_DESKTOP; - if (tools_isactive( desktop, TOOLS_NODES)) { - Inkscape::UI::Tools::NodeTool *nt = static_cast( desktop->event_context); - nt->update_helperpath(); - } - } } void @@ -130,6 +123,10 @@ PointParam::param_set_and_write_new_value (Geom::Point newpoint) gchar * str = g_strdup(os.str().c_str()); param_write_to_repr(str); g_free(str); + SPLPEItem* item = reinterpret_cast(param_effect->getLPEObj()); + if(item){ + sp_lpe_item_update_patheffect(item, false, false); + } } void -- cgit v1.2.3