summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-03-14 11:37:42 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-03-14 11:37:42 +0000
commiteb041b9a00e42b585bac8fec8cbcb0650d058703 (patch)
treefa6bb6388a318c776ad1268011f234b38d50295a /src
parentTranslations. Catalan translation update. (diff)
downloadinkscape-eb041b9a00e42b585bac8fec8cbcb0650d058703.tar.gz
inkscape-eb041b9a00e42b585bac8fec8cbcb0650d058703.zip
Remove 'Active Desktop' calls from Perspective/Envelope and Lattice2 LPE, added auto refresh knots position in point parameters when updated programaticaly
(bzr r14003)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/lpe-lattice2.cpp16
-rw-r--r--src/live_effects/lpe-perspective-envelope.cpp16
-rw-r--r--src/live_effects/parameter/point.cpp7
-rw-r--r--src/live_effects/parameter/point.h1
4 files changed, 7 insertions, 33 deletions
diff --git a/src/live_effects/lpe-lattice2.cpp b/src/live_effects/lpe-lattice2.cpp
index 1916fc2d4..08bbbd504 100644
--- a/src/live_effects/lpe-lattice2.cpp
+++ b/src/live_effects/lpe-lattice2.cpp
@@ -34,9 +34,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;
@@ -493,19 +490,6 @@ LPELattice2::resetGrid()
grid_point28x30.param_set_default();
grid_point29x31.param_set_default();
grid_point32x33x34x35.param_set_default();
- /*todo:this hack is only to reposition the knots on reset grid button
- Better update path effect in LPEITEM
- if(sp_lpe_item){
- sp_lpe_item_update_patheffect(sp_lpe_item, true, true);
- SPGroup *group = dynamic_cast<SPGroup *>(sp_lpe_item);
- if(group){
- group->requestModified(SP_OBJECT_MODIFIED_FLAG);
- }
- }
- */
- 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 f355fa683..d60a13c23 100644
--- a/src/live_effects/lpe-perspective-envelope.cpp
+++ b/src/live_effects/lpe-perspective-envelope.cpp
@@ -20,9 +20,6 @@
#include "display/curve.h"
#include "svg/svg.h"
#include <gsl/gsl_linalg.h>
-#include "ui/tools-switch.h"
-
-#include "desktop.h" // TODO: should be factored out (see below)
using namespace Geom;
@@ -336,19 +333,6 @@ LPEPerspectiveEnvelope::resetGrid()
Up_Right_Point.param_set_default();
Down_Right_Point.param_set_default();
Down_Left_Point.param_set_default();
- /*todo:this hack is only to reposition the knots on reser grid button
- Better update path effect in LPEITEM
- if(sp_lpe_item){
- sp_lpe_item_update_patheffect(sp_lpe_item, true, true);
- SPGroup *group = dynamic_cast<SPGroup *>(sp_lpe_item);
- if(group){
- group->requestModified(SP_OBJECT_MODIFIED_FLAG);
- }
- }
- */
- 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 aece8fb79..4564363db 100644
--- a/src/live_effects/parameter/point.cpp
+++ b/src/live_effects/parameter/point.cpp
@@ -27,7 +27,8 @@ PointParam::PointParam( const Glib::ustring& label, const Glib::ustring& tip,
const Glib::ustring& key, Inkscape::UI::Widget::Registry* wr,
Effect* effect, const gchar *htip, Geom::Point default_value)
: Parameter(label, tip, key, wr, effect),
- defvalue(default_value)
+ defvalue(default_value),
+ knoth(NULL)
{
knot_shape = SP_KNOT_SHAPE_DIAMOND;
knot_mode = SP_KNOT_MODE_XOR;
@@ -69,6 +70,9 @@ PointParam::param_setValue(Geom::Point newpoint, bool write)
param_write_to_repr(str);
g_free(str);
}
+ if(knoth){
+ knoth->update_knots();
+ }
}
bool
@@ -192,6 +196,7 @@ PointParamKnotHolderEntity::knot_click(guint state)
void
PointParam::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item)
{
+ knoth = knotholder;
PointParamKnotHolderEntity *e = new PointParamKnotHolderEntity(this);
// TODO: can we ditch handleTip() etc. because we have access to handle_tip etc. itself???
e->create(desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN, handleTip(), knot_shape, knot_mode, knot_color);
diff --git a/src/live_effects/parameter/point.h b/src/live_effects/parameter/point.h
index 32433713a..471fbc993 100644
--- a/src/live_effects/parameter/point.h
+++ b/src/live_effects/parameter/point.h
@@ -54,6 +54,7 @@ private:
PointParam(const PointParam&);
PointParam& operator=(const PointParam&);
Geom::Point defvalue;
+ KnotHolder *knoth;
SPKnotShapeType knot_shape;
SPKnotModeType knot_mode;
guint32 knot_color;