From 30e74d438ef362634967a47053ecf27fb950e340 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sat, 2 Jul 2016 02:27:56 +0200 Subject: Fix bug #1598009 regression on path parameter Fixed bugs: - https://launchpad.net/bugs/1598009 (bzr r15004) --- src/live_effects/parameter/path.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/live_effects/parameter/path.cpp') diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index bed191e83..f0c494267 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -237,7 +237,6 @@ PathParam::param_editOncanvas(SPItem *item, SPDesktop * dt) r.role = SHAPE_ROLE_LPE_PARAM; r.edit_transform = item->i2dt_affine(); // TODO is it right? - r.edit_transform *= item->transform.inverse(); if (!href) { r.item = reinterpret_cast(param_effect->getLPEObj()); r.lpe_key = param_key; @@ -458,8 +457,7 @@ PathParam::paste_param_path(const char *svgd) SPItem * item = SP_ACTIVE_DESKTOP->getSelection()->singleItem(); if (item != NULL) { Geom::PathVector path_clipboard = sp_svg_read_pathv(svgd); - path_clipboard *= item->i2doc_affine().inverse() * item->transform; - path_clipboard *= Geom::Translate(path_clipboard.initialPoint() - _pathvector.initialPoint()).inverse(); + path_clipboard *= item->i2doc_affine().inverse(); svgd = sp_svg_write_path( path_clipboard ); } -- cgit v1.2.3 From 349536d49558ec5841e799eb33a4cbbb3fa9722d Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Sun, 5 Feb 2017 16:04:35 +0000 Subject: Fix C++11 errors and warnings with g++-7 Fixed bugs: - https://launchpad.net/bugs/1660992 (bzr r15477) --- src/live_effects/parameter/path.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/live_effects/parameter/path.cpp') diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index f0c494267..dafc6d406 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -5,10 +5,16 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include "ui/widget/point.h" +#include "live_effects/parameter/path.h" + #include -#include "live_effects/parameter/path.h" +#include +#include + +#include "bad-uri-exception.h" +#include "ui/widget/point.h" + #include "live_effects/effect.h" #include "svg/svg.h" #include <2geom/svg-path-parser.h> @@ -17,7 +23,6 @@ #include <2geom/d2.h> #include "widgets/icon.h" -#include #include "selection-chemistry.h" #include "xml/repr.h" #include "desktop.h" @@ -44,8 +49,6 @@ #include "ui/tool/multi-path-manipulator.h" #include "ui/tool/shape-record.h" -#include -#include #include "ui/icon-names.h" namespace Inkscape { -- cgit v1.2.3 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/path.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/live_effects/parameter/path.cpp') diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index dafc6d406..aa87508ab 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -439,6 +439,10 @@ PathParam::linked_modified_callback(SPObject *linked_obj, guint /*flags*/) SP_OBJECT(param_effect->getLPEObj())->requestModified(SP_OBJECT_MODIFIED_FLAG); } +void +PathParam::param_update_default(const gchar * default_value){ + defvalue = strdup(default_value); +} /* CALLBACK FUNCTIONS FOR THE BUTTONS */ void -- 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/path.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/live_effects/parameter/path.cpp') diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index aa87508ab..9bdebaf47 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -170,9 +170,19 @@ PathParam::param_getSVGValue() const Gtk::Widget * PathParam::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; + } Gtk::HBox * _widget = Gtk::manage(new Gtk::HBox()); - Gtk::Label* pLabel = Gtk::manage(new Gtk::Label(param_label)); + Gtk::Label* pLabel = Gtk::manage(new Gtk::Label(label)); static_cast(_widget)->pack_start(*pLabel, true, true); pLabel->set_tooltip_text(param_tooltip); -- 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/path.cpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'src/live_effects/parameter/path.cpp') diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index 9bdebaf47..dafc6d406 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -170,19 +170,9 @@ PathParam::param_getSVGValue() const Gtk::Widget * PathParam::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; - } Gtk::HBox * _widget = Gtk::manage(new Gtk::HBox()); - Gtk::Label* pLabel = Gtk::manage(new Gtk::Label(label)); + Gtk::Label* pLabel = Gtk::manage(new Gtk::Label(param_label)); static_cast(_widget)->pack_start(*pLabel, true, true); pLabel->set_tooltip_text(param_tooltip); @@ -449,10 +439,6 @@ PathParam::linked_modified_callback(SPObject *linked_obj, guint /*flags*/) SP_OBJECT(param_effect->getLPEObj())->requestModified(SP_OBJECT_MODIFIED_FLAG); } -void -PathParam::param_update_default(const gchar * default_value){ - defvalue = strdup(default_value); -} /* CALLBACK FUNCTIONS FOR THE BUTTONS */ void -- 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/path.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/live_effects/parameter/path.cpp') diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index dafc6d406..aa87508ab 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -439,6 +439,10 @@ PathParam::linked_modified_callback(SPObject *linked_obj, guint /*flags*/) SP_OBJECT(param_effect->getLPEObj())->requestModified(SP_OBJECT_MODIFIED_FLAG); } +void +PathParam::param_update_default(const gchar * default_value){ + defvalue = strdup(default_value); +} /* CALLBACK FUNCTIONS FOR THE BUTTONS */ void -- cgit v1.2.3 From 6c05c1c14cb8d29fb06d6779ec9817615c518ab5 Mon Sep 17 00:00:00 2001 From: chr Date: Thu, 18 May 2017 19:58:59 +0200 Subject: fix a brunch of memory leaks (bzr r15698.1.2) --- src/live_effects/parameter/path.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/live_effects/parameter/path.cpp') diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index aa87508ab..6e90c9279 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -245,8 +245,9 @@ PathParam::param_editOncanvas(SPItem *item, SPDesktop * dt) r.lpe_key = param_key; Geom::PathVector stored_pv = _pathvector; param_write_to_repr("M0,0 L1,0"); - const char *svgd = sp_svg_write_path(stored_pv); + gchar *svgd = sp_svg_write_path(stored_pv); param_write_to_repr(svgd); + g_free(svgd); } else { r.item = ref.getObject(); } -- cgit v1.2.3 From 5f75967b19b3cc95f249194fa13a2e04ef582c36 Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Sun, 28 May 2017 07:40:43 +0200 Subject: Force not original-d if the clip-path or mask has not a LPE allowed to change it (bzr r15707) --- src/live_effects/parameter/path.cpp | 104 +++++++++++++++++++++--------------- 1 file changed, 62 insertions(+), 42 deletions(-) (limited to 'src/live_effects/parameter/path.cpp') diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index 6e90c9279..54f5d93e8 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -69,7 +69,10 @@ PathParam::PathParam( const Glib::ustring& label, const Glib::ustring& tip, defvalue = g_strdup(default_value); param_readSVGValue(defvalue); oncanvas_editable = true; - + _edit_button = true; + _copy_button = true; + _paste_button = true; + _link_button = true; ref_changed_connection = ref.changedSignal().connect(sigc::mem_fun(*this, &PathParam::ref_changed)); } @@ -167,6 +170,15 @@ PathParam::param_getSVGValue() const } } +void +PathParam::set_buttons(bool edit_button, bool copy_button, bool paste_button, bool link_button) +{ + _edit_button = edit_button; + _copy_button = copy_button; + _paste_button = paste_button; + _link_button = link_button; +} + Gtk::Widget * PathParam::param_newWidget() { @@ -175,47 +187,55 @@ PathParam::param_newWidget() Gtk::Label* pLabel = Gtk::manage(new Gtk::Label(param_label)); static_cast(_widget)->pack_start(*pLabel, true, true); pLabel->set_tooltip_text(param_tooltip); - - Gtk::Widget* pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("tool-node-editor"), Inkscape::ICON_SIZE_BUTTON) ); - Gtk::Button * pButton = Gtk::manage(new Gtk::Button()); - pButton->set_relief(Gtk::RELIEF_NONE); - pIcon->show(); - pButton->add(*pIcon); - pButton->show(); - pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_edit_button_click)); - static_cast(_widget)->pack_start(*pButton, true, true); - pButton->set_tooltip_text(_("Edit on-canvas")); - - pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-copy"), Inkscape::ICON_SIZE_BUTTON) ); - pButton = Gtk::manage(new Gtk::Button()); - pButton->set_relief(Gtk::RELIEF_NONE); - pIcon->show(); - pButton->add(*pIcon); - pButton->show(); - pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_copy_button_click)); - static_cast(_widget)->pack_start(*pButton, true, true); - pButton->set_tooltip_text(_("Copy path")); - - pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-paste"), Inkscape::ICON_SIZE_BUTTON) ); - pButton = Gtk::manage(new Gtk::Button()); - pButton->set_relief(Gtk::RELIEF_NONE); - pIcon->show(); - pButton->add(*pIcon); - pButton->show(); - pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_paste_button_click)); - static_cast(_widget)->pack_start(*pButton, true, true); - pButton->set_tooltip_text(_("Paste path")); - - pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-clone"), Inkscape::ICON_SIZE_BUTTON) ); - pButton = Gtk::manage(new Gtk::Button()); - pButton->set_relief(Gtk::RELIEF_NONE); - pIcon->show(); - pButton->add(*pIcon); - pButton->show(); - pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_link_button_click)); - static_cast(_widget)->pack_start(*pButton, true, true); - pButton->set_tooltip_text(_("Link to path on clipboard")); - + Gtk::Widget * pIcon = NULL; + Gtk::Button * pButton = NULL; + if (_edit_button) { + pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("tool-node-editor"), Inkscape::ICON_SIZE_BUTTON) ); + pButton = Gtk::manage(new Gtk::Button()); + pButton->set_relief(Gtk::RELIEF_NONE); + pIcon->show(); + pButton->add(*pIcon); + pButton->show(); + pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_edit_button_click)); + static_cast(_widget)->pack_start(*pButton, true, true); + pButton->set_tooltip_text(_("Edit on-canvas")); + } + + if (_copy_button) { + pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-copy"), Inkscape::ICON_SIZE_BUTTON) ); + pButton = Gtk::manage(new Gtk::Button()); + pButton->set_relief(Gtk::RELIEF_NONE); + pIcon->show(); + pButton->add(*pIcon); + pButton->show(); + pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_copy_button_click)); + static_cast(_widget)->pack_start(*pButton, true, true); + pButton->set_tooltip_text(_("Copy path")); + } + + if (_paste_button) { + pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-paste"), Inkscape::ICON_SIZE_BUTTON) ); + pButton = Gtk::manage(new Gtk::Button()); + pButton->set_relief(Gtk::RELIEF_NONE); + pIcon->show(); + pButton->add(*pIcon); + pButton->show(); + pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_paste_button_click)); + static_cast(_widget)->pack_start(*pButton, true, true); + pButton->set_tooltip_text(_("Paste path")); + } + if (_link_button) { + pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-clone"), Inkscape::ICON_SIZE_BUTTON) ); + pButton = Gtk::manage(new Gtk::Button()); + pButton->set_relief(Gtk::RELIEF_NONE); + pIcon->show(); + pButton->add(*pIcon); + pButton->show(); + pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_link_button_click)); + static_cast(_widget)->pack_start(*pButton, true, true); + pButton->set_tooltip_text(_("Link to path on clipboard")); + } + static_cast(_widget)->show_all_children(); return dynamic_cast (_widget); -- cgit v1.2.3