From 3103b99b4cf6c1048c89f75e280761d8cd0ca1c2 Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Sat, 15 Apr 2017 00:20:13 +0200 Subject: Allow set and reset default values of LPE parameters (bzr r15620.1.1) --- src/live_effects/parameter/point.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/live_effects/parameter/point.cpp') diff --git a/src/live_effects/parameter/point.cpp b/src/live_effects/parameter/point.cpp index c87b1e299..683cadc1f 100644 --- a/src/live_effects/parameter/point.cpp +++ b/src/live_effects/parameter/point.cpp @@ -59,11 +59,24 @@ PointParam::param_get_default() const{ } void -PointParam::param_update_default(const Geom::Point default_point) +PointParam::param_update_default(Geom::Point default_point) { defvalue = default_point; } +void +PointParam::param_update_default(const gchar * default_point) +{ + gchar ** strarray = g_strsplit(default_point, ",", 2); + double newx, newy; + unsigned int success = sp_svg_number_read_d(strarray[0], &newx); + success += sp_svg_number_read_d(strarray[1], &newy); + g_strfreev (strarray); + if (success == 2) { + param_update_default( Geom::Point(newx, newy) ); + } +} + void PointParam::param_setValue(Geom::Point newpoint, bool write) { -- cgit v1.2.3 From 62036c3e30d6188ee9372b36b25f7ef9bdfea5c0 Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Sat, 15 Apr 2017 15:28:29 +0200 Subject: Fixes crashes with LPE point parameter (bzr r15623) --- src/live_effects/parameter/point.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'src/live_effects/parameter/point.cpp') diff --git a/src/live_effects/parameter/point.cpp b/src/live_effects/parameter/point.cpp index c87b1e299..db768090a 100644 --- a/src/live_effects/parameter/point.cpp +++ b/src/live_effects/parameter/point.cpp @@ -26,8 +26,7 @@ PointParam::PointParam( const Glib::ustring& label, const Glib::ustring& tip, : Parameter(label, tip, key, wr, effect), defvalue(default_value), liveupdate(live_update), - knoth(NULL), - _pointwdg(NULL) + knoth(NULL) { knot_shape = SP_KNOT_SHAPE_DIAMOND; knot_mode = SP_KNOT_MODE_XOR; @@ -59,7 +58,7 @@ PointParam::param_get_default() const{ } void -PointParam::param_update_default(const Geom::Point default_point) +PointParam::param_update_default(Geom::Point default_point) { defvalue = default_point; } @@ -78,9 +77,7 @@ PointParam::param_setValue(Geom::Point newpoint, bool write) if(knoth && liveupdate){ knoth->update_knots(); } - if (_pointwdg) { - _pointwdg->setValue( newpoint ); - } + param_effect->upd_params = true; } bool @@ -116,7 +113,7 @@ PointParam::param_transform_multiply(Geom::Affine const& postmul, bool /*set*/) Gtk::Widget * PointParam::param_newWidget() { - _pointwdg = Gtk::manage( + Inkscape::UI::Widget::RegisteredTransformedPoint * pointwdg = Gtk::manage( new Inkscape::UI::Widget::RegisteredTransformedPoint( param_label, param_tooltip, param_key, @@ -125,13 +122,13 @@ PointParam::param_newWidget() param_effect->getSPDoc() ) ); Geom::Affine transf = Geom::Scale(1, -1); transf[5] = SP_ACTIVE_DOCUMENT->getHeight().value("px"); - _pointwdg->setTransform(transf); - _pointwdg->setValue( *this ); - _pointwdg->clearProgrammatically(); - _pointwdg->set_undo_parameters(SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Change point parameter")); + pointwdg->setTransform(transf); + pointwdg->setValue( *this ); + pointwdg->clearProgrammatically(); + pointwdg->set_undo_parameters(SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Change point parameter")); Gtk::HBox * hbox = Gtk::manage( new Gtk::HBox() ); - static_cast(hbox)->pack_start(*_pointwdg, true, true); + static_cast(hbox)->pack_start(*pointwdg, true, true); static_cast(hbox)->show_all_children(); param_effect->upd_params = false; return dynamic_cast (hbox); -- cgit v1.2.3 From 18e032118bbb1718778c6f2e5e55cdb1723dc1ce Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Thu, 27 Apr 2017 12:05:03 +0200 Subject: Add end of preferences GUI (bzr r15620.1.6) --- src/live_effects/parameter/point.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/live_effects/parameter/point.cpp') diff --git a/src/live_effects/parameter/point.cpp b/src/live_effects/parameter/point.cpp index 561f1b34c..2fbe4b3b4 100644 --- a/src/live_effects/parameter/point.cpp +++ b/src/live_effects/parameter/point.cpp @@ -126,8 +126,18 @@ PointParam::param_transform_multiply(Geom::Affine const& postmul, bool /*set*/) Gtk::Widget * PointParam::param_newWidget() { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + Glib::ustring effectkey = (Glib::ustring)Inkscape::LivePathEffect::LPETypeConverter.get_key(param_effect->effectType()); + Glib::ustring pref_path = (Glib::ustring)"/live_effects/" + + effectkey + + (Glib::ustring)"/" + + (Glib::ustring)param_key; + Glib::ustring label = param_label; + if(prefs->getEntry(pref_path).isValid()){ + label = (Glib::ustring)"* " + param_label; + } Inkscape::UI::Widget::RegisteredTransformedPoint * pointwdg = Gtk::manage( - new Inkscape::UI::Widget::RegisteredTransformedPoint( param_label, + new Inkscape::UI::Widget::RegisteredTransformedPoint( label, param_tooltip, param_key, *param_wr, -- cgit v1.2.3 From 52054e24f8b98c07753588c726a1e777bad7245b Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Fri, 28 Apr 2017 21:42:36 +0200 Subject: Reset (bzr r15620.1.9) --- src/live_effects/parameter/point.cpp | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'src/live_effects/parameter/point.cpp') diff --git a/src/live_effects/parameter/point.cpp b/src/live_effects/parameter/point.cpp index 2fbe4b3b4..db768090a 100644 --- a/src/live_effects/parameter/point.cpp +++ b/src/live_effects/parameter/point.cpp @@ -63,19 +63,6 @@ PointParam::param_update_default(Geom::Point default_point) defvalue = default_point; } -void -PointParam::param_update_default(const gchar * default_point) -{ - gchar ** strarray = g_strsplit(default_point, ",", 2); - double newx, newy; - unsigned int success = sp_svg_number_read_d(strarray[0], &newx); - success += sp_svg_number_read_d(strarray[1], &newy); - g_strfreev (strarray); - if (success == 2) { - param_update_default( Geom::Point(newx, newy) ); - } -} - void PointParam::param_setValue(Geom::Point newpoint, bool write) { @@ -126,18 +113,8 @@ PointParam::param_transform_multiply(Geom::Affine const& postmul, bool /*set*/) Gtk::Widget * PointParam::param_newWidget() { - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - Glib::ustring effectkey = (Glib::ustring)Inkscape::LivePathEffect::LPETypeConverter.get_key(param_effect->effectType()); - Glib::ustring pref_path = (Glib::ustring)"/live_effects/" + - effectkey + - (Glib::ustring)"/" + - (Glib::ustring)param_key; - Glib::ustring label = param_label; - if(prefs->getEntry(pref_path).isValid()){ - label = (Glib::ustring)"* " + param_label; - } Inkscape::UI::Widget::RegisteredTransformedPoint * pointwdg = Gtk::manage( - new Inkscape::UI::Widget::RegisteredTransformedPoint( label, + new Inkscape::UI::Widget::RegisteredTransformedPoint( param_label, param_tooltip, param_key, *param_wr, -- cgit v1.2.3 From e5601e5e84df30c40d93271fd69cecd31391e309 Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Sat, 29 Apr 2017 02:01:22 +0200 Subject: Rewrite UX (bzr r15620.1.12) --- src/live_effects/parameter/point.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/live_effects/parameter/point.cpp') diff --git a/src/live_effects/parameter/point.cpp b/src/live_effects/parameter/point.cpp index db768090a..561f1b34c 100644 --- a/src/live_effects/parameter/point.cpp +++ b/src/live_effects/parameter/point.cpp @@ -63,6 +63,19 @@ PointParam::param_update_default(Geom::Point default_point) defvalue = default_point; } +void +PointParam::param_update_default(const gchar * default_point) +{ + gchar ** strarray = g_strsplit(default_point, ",", 2); + double newx, newy; + unsigned int success = sp_svg_number_read_d(strarray[0], &newx); + success += sp_svg_number_read_d(strarray[1], &newy); + g_strfreev (strarray); + if (success == 2) { + param_update_default( Geom::Point(newx, newy) ); + } +} + void PointParam::param_setValue(Geom::Point newpoint, bool write) { -- cgit v1.2.3 From a3d1689c18ebf132acb7ae0501ec419a71e48a85 Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Mon, 1 May 2017 03:15:26 +0200 Subject: Fix erase lpe in multi LPE mode Improve rendering widgets, simplify the code, redraw widgets each time not only on odd iterations (bzr r15655) --- src/live_effects/parameter/point.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/live_effects/parameter/point.cpp') diff --git a/src/live_effects/parameter/point.cpp b/src/live_effects/parameter/point.cpp index db768090a..55dc79fe8 100644 --- a/src/live_effects/parameter/point.cpp +++ b/src/live_effects/parameter/point.cpp @@ -77,7 +77,6 @@ PointParam::param_setValue(Geom::Point newpoint, bool write) if(knoth && liveupdate){ knoth->update_knots(); } - param_effect->upd_params = true; } bool @@ -130,7 +129,6 @@ PointParam::param_newWidget() Gtk::HBox * hbox = Gtk::manage( new Gtk::HBox() ); static_cast(hbox)->pack_start(*pointwdg, true, true); static_cast(hbox)->show_all_children(); - param_effect->upd_params = false; return dynamic_cast (hbox); } -- cgit v1.2.3 From 561ec7df77bc2e499dc525d987a8be4552e9ea41 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Fri, 5 May 2017 16:41:34 +0200 Subject: Improve responsive from LPE Fixed bugs: - https://launchpad.net/bugs/1688168 (bzr r15662) --- src/live_effects/parameter/point.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/live_effects/parameter/point.cpp') diff --git a/src/live_effects/parameter/point.cpp b/src/live_effects/parameter/point.cpp index 55dc79fe8..e5216bf2d 100644 --- a/src/live_effects/parameter/point.cpp +++ b/src/live_effects/parameter/point.cpp @@ -168,7 +168,7 @@ PointParamKnotHolderEntity::knot_set(Geom::Point const &p, Geom::Point const &or s = A; } } - pparam->param_setValue(s, this->pparam->liveupdate); + pparam->param_setValue(s); SPLPEItem * splpeitem = dynamic_cast(item); if(splpeitem && this->pparam->liveupdate){ sp_lpe_item_update_patheffect(splpeitem, false, false); -- cgit v1.2.3