summaryrefslogtreecommitdiffstats
path: root/src/live_effects/parameter
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2016-01-17 19:18:53 +0000
committerjabiertxof <info@marker.es>2016-01-17 19:18:53 +0000
commitb3719f65d1bb2ee5ab7fd3bc67f92a657732580d (patch)
tree8f428bb289b37f2f2e902f254b17b3cc8f0ba4a0 /src/live_effects/parameter
parentLatvian translation update (diff)
downloadinkscape-b3719f65d1bb2ee5ab7fd3bc67f92a657732580d.tar.gz
inkscape-b3719f65d1bb2ee5ab7fd3bc67f92a657732580d.zip
Add option to Lattice2 to update LPE only on release knot.
This could be useful if item is too complex, making previous knots unusable This can be used in other LPE if anyone want or ping me to it. Maybe could be usefull add similar thing to path parameter, Same slow item become tooooo slow with bend path. (bzr r14604)
Diffstat (limited to 'src/live_effects/parameter')
-rw-r--r--src/live_effects/parameter/point.cpp16
-rw-r--r--src/live_effects/parameter/point.h7
2 files changed, 17 insertions, 6 deletions
diff --git a/src/live_effects/parameter/point.cpp b/src/live_effects/parameter/point.cpp
index 4c4d2cd9c..ca3471b29 100644
--- a/src/live_effects/parameter/point.cpp
+++ b/src/live_effects/parameter/point.cpp
@@ -25,9 +25,11 @@ namespace LivePathEffect {
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)
+ Effect* effect, const gchar *htip, Geom::Point default_value,
+ bool live_update )
: Parameter(label, tip, key, wr, effect),
defvalue(default_value),
+ liveupdate(live_update),
knoth(NULL)
{
knot_shape = SP_KNOT_SHAPE_DIAMOND;
@@ -48,6 +50,12 @@ PointParam::param_set_default()
param_setValue(defvalue,true);
}
+void
+PointParam::param_set_liveupdate( bool live_update)
+{
+ liveupdate = live_update;
+}
+
Geom::Point
PointParam::param_get_default() const{
return defvalue;
@@ -70,7 +78,7 @@ PointParam::param_setValue(Geom::Point newpoint, bool write)
param_write_to_repr(str);
g_free(str);
}
- if(knoth){
+ if(knoth && liveupdate){
knoth->update_knots();
}
}
@@ -166,9 +174,9 @@ PointParamKnotHolderEntity::knot_set(Geom::Point const &p, Geom::Point const &or
s = A;
}
}
- pparam->param_setValue(s, true);
+ pparam->param_setValue(s, this->pparam->liveupdate);
SPLPEItem * splpeitem = dynamic_cast<SPLPEItem *>(item);
- if(splpeitem){
+ if(splpeitem && this->pparam->liveupdate){
sp_lpe_item_update_patheffect(splpeitem, false, false);
}
}
diff --git a/src/live_effects/parameter/point.h b/src/live_effects/parameter/point.h
index 471fbc993..4329e0bcd 100644
--- a/src/live_effects/parameter/point.h
+++ b/src/live_effects/parameter/point.h
@@ -29,8 +29,9 @@ public:
const Glib::ustring& key,
Inkscape::UI::Widget::Registry* wr,
Effect* effect,
- const gchar *handle_tip = NULL,
- Geom::Point default_value = Geom::Point(0,0) ); // tip for automatically associated on-canvas handle
+ const gchar *handle_tip = NULL,// tip for automatically associated on-canvas handle
+ Geom::Point default_value = Geom::Point(0,0),
+ bool live_update = true );
virtual ~PointParam();
virtual Gtk::Widget * param_newWidget();
@@ -41,6 +42,7 @@ public:
void param_setValue(Geom::Point newpoint, bool write = false);
void param_set_default();
Geom::Point param_get_default() const;
+ void param_set_liveupdate(bool live_update);
void param_update_default(Geom::Point newpoint);
virtual void param_transform_multiply(Geom::Affine const& /*postmul*/, bool /*set*/);
@@ -54,6 +56,7 @@ private:
PointParam(const PointParam&);
PointParam& operator=(const PointParam&);
Geom::Point defvalue;
+ bool liveupdate;
KnotHolder *knoth;
SPKnotShapeType knot_shape;
SPKnotModeType knot_mode;