From 3a6de49f3e570d7646984a800972da6c1ee2154b Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Mon, 2 Mar 2015 01:24:22 +0100 Subject: Added shorcut to move along axes, point reseteable parameter,pointed by Vlada, also fixed some UX styles in lattice2 and perspective envelope, pointed by suv. A question: Can I update point parameter whith pointreseteable parameter features, to have only one point parameter? (bzr r13959) --- src/live_effects/lpe-perspective-envelope.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/live_effects/lpe-perspective-envelope.cpp') diff --git a/src/live_effects/lpe-perspective-envelope.cpp b/src/live_effects/lpe-perspective-envelope.cpp index b5ef26e2f..d38427d0a 100644 --- a/src/live_effects/lpe-perspective-envelope.cpp +++ b/src/live_effects/lpe-perspective-envelope.cpp @@ -44,10 +44,10 @@ LPEPerspectiveEnvelope::LPEPerspectiveEnvelope(LivePathEffectObject *lpeobject) Effect(lpeobject), // initialise your parameters here: deform_type(_("Type"), _("Select the type of deformation"), "deform_type", DeformationTypeConverter, &wr, this, DEFORMATION_PERSPECTIVE), - Up_Left_Point(_("Top Left"), _("Top Left - Ctrl+Alt+Click to reset"), "Up_Left_Point", &wr, this), - Up_Right_Point(_("Top Right"), _("Top Right - Ctrl+Alt+Click to reset"), "Up_Right_Point", &wr, this), - Down_Left_Point(_("Down Left"), _("Down Left - Ctrl+Alt+Click to reset"), "Down_Left_Point", &wr, this), - Down_Right_Point(_("Down Right"), _("Down Right - Ctrl+Alt+Click to reset"), "Down_Right_Point", &wr, this) + Up_Left_Point(_("Top Left"), _("Top Left - Ctrl+Alt+Click: reset, Ctrl: move along axes"), "Up_Left_Point", &wr, this), + Up_Right_Point(_("Top Right"), _("Top Right - Ctrl+Alt+Click: reset, Ctrl: move along axes"), "Up_Right_Point", &wr, this), + Down_Left_Point(_("Down Left"), _("Down Left - Ctrl+Alt+Click: reset, Ctrl: move along axes"), "Down_Left_Point", &wr, this), + Down_Right_Point(_("Down Right"), _("Down Right - Ctrl+Alt+Click: reset, Ctrl: move along axes"), "Down_Right_Point", &wr, this) { // register all your parameters here, so Inkscape knows which parameters this effect has: registerParameter( dynamic_cast(&deform_type)); @@ -298,7 +298,7 @@ LPEPerspectiveEnvelope::newWidget() Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false,0)); Gtk::Button* resetButton = Gtk::manage(new Gtk::Button(Gtk::Stock::CLEAR)); resetButton->signal_clicked().connect(sigc::mem_fun (*this,&LPEPerspectiveEnvelope::resetGrid)); - resetButton->set_size_request(140,45); + resetButton->set_size_request(140,30); vbox->pack_start(*hbox, true,true,2); hbox->pack_start(*resetButton, false, false,2); return dynamic_cast(vbox); -- cgit v1.2.3 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-perspective-envelope.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/live_effects/lpe-perspective-envelope.cpp') 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 -- cgit v1.2.3 From 7240de5809d66a6f14e578d37396bfaa97ee8f08 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Wed, 11 Mar 2015 00:57:47 +0100 Subject: Final cleanup to point parameter, lattice2 and perspective envelope. Also added to lattice 2 a symmetry options (bzr r13989) --- src/live_effects/lpe-perspective-envelope.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/live_effects/lpe-perspective-envelope.cpp') diff --git a/src/live_effects/lpe-perspective-envelope.cpp b/src/live_effects/lpe-perspective-envelope.cpp index 74c870498..77d487c2a 100644 --- a/src/live_effects/lpe-perspective-envelope.cpp +++ b/src/live_effects/lpe-perspective-envelope.cpp @@ -334,6 +334,7 @@ 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(); + sp_lpe_item_update_patheffect(sp_lpe_item, false, false); } void -- cgit v1.2.3 From 5639c270b1b4c509ada273d79dda1d0a60fea1ed Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Wed, 11 Mar 2015 09:09:28 +0100 Subject: Inicialite variables to prevent crashes (bzr r13990) --- src/live_effects/lpe-perspective-envelope.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/live_effects/lpe-perspective-envelope.cpp') diff --git a/src/live_effects/lpe-perspective-envelope.cpp b/src/live_effects/lpe-perspective-envelope.cpp index 77d487c2a..e4e75cf4d 100644 --- a/src/live_effects/lpe-perspective-envelope.cpp +++ b/src/live_effects/lpe-perspective-envelope.cpp @@ -334,7 +334,9 @@ 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(); - sp_lpe_item_update_patheffect(sp_lpe_item, false, false); + if(sp_lpe_item){ + sp_lpe_item_update_patheffect(sp_lpe_item, false, false); + } } void -- cgit v1.2.3 From c9a989288ac802c9f7ca65f387827a3c2e991741 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Thu, 12 Mar 2015 09:19:08 +0100 Subject: Point parameter refactor, Fixes a bug in Lattice2 whith lines. (bzr r13995) --- src/live_effects/lpe-perspective-envelope.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/live_effects/lpe-perspective-envelope.cpp') diff --git a/src/live_effects/lpe-perspective-envelope.cpp b/src/live_effects/lpe-perspective-envelope.cpp index e4e75cf4d..f355fa683 100644 --- a/src/live_effects/lpe-perspective-envelope.cpp +++ b/src/live_effects/lpe-perspective-envelope.cpp @@ -20,7 +20,9 @@ #include "display/curve.h" #include "svg/svg.h" #include +#include "ui/tools-switch.h" +#include "desktop.h" // TODO: should be factored out (see below) using namespace Geom; @@ -330,13 +332,23 @@ LPEPerspectiveEnvelope::setDefaults() void LPEPerspectiveEnvelope::resetGrid() { - Up_Left_Point.param_set_and_write_default(); - Up_Right_Point.param_set_and_write_default(); - Down_Right_Point.param_set_and_write_default(); - Down_Left_Point.param_set_and_write_default(); + Up_Left_Point.param_set_default(); + 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, false, false); + sp_lpe_item_update_patheffect(sp_lpe_item, true, true); + SPGroup *group = dynamic_cast(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 @@ -344,8 +356,8 @@ LPEPerspectiveEnvelope::resetDefaults(SPItem const* item) { Effect::resetDefaults(item); original_bbox(SP_LPE_ITEM(item)); - setDefaults(); resetGrid(); + setDefaults(); } void -- cgit v1.2.3 From eb041b9a00e42b585bac8fec8cbcb0650d058703 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sat, 14 Mar 2015 12:37:42 +0100 Subject: Remove 'Active Desktop' calls from Perspective/Envelope and Lattice2 LPE, added auto refresh knots position in point parameters when updated programaticaly (bzr r14003) --- src/live_effects/lpe-perspective-envelope.cpp | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'src/live_effects/lpe-perspective-envelope.cpp') 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 -#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(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 -- cgit v1.2.3