summaryrefslogtreecommitdiffstats
path: root/src/live_effects/parameter
diff options
context:
space:
mode:
authorJabiertxo Arraiza Cenoz <jtx@jtx-desktop.markerlab.es>2017-09-13 15:10:44 +0000
committerJabiertxo Arraiza Cenoz <jtx@jtx-desktop.markerlab.es>2017-09-13 15:10:44 +0000
commitb5d3bcd190a8b4c95613eeb82e2b768b08b693ce (patch)
treee8bf377ac1a28cfadc399bb4d7d603c84b230ba8 /src/live_effects/parameter
parentImprove rendering of vertical text with non-spacing marks in upright orientat... (diff)
downloadinkscape-b5d3bcd190a8b4c95613eeb82e2b768b08b693ce.tar.gz
inkscape-b5d3bcd190a8b4c95613eeb82e2b768b08b693ce.zip
Fixes for clone original LPE
Diffstat (limited to 'src/live_effects/parameter')
-rw-r--r--src/live_effects/parameter/originalpatharray.cpp35
-rw-r--r--src/live_effects/parameter/originalpatharray.h7
2 files changed, 24 insertions, 18 deletions
diff --git a/src/live_effects/parameter/originalpatharray.cpp b/src/live_effects/parameter/originalpatharray.cpp
index 13bd23634..0b1eb4802 100644
--- a/src/live_effects/parameter/originalpatharray.cpp
+++ b/src/live_effects/parameter/originalpatharray.cpp
@@ -326,28 +326,25 @@ OriginalPathArrayParam::on_link_button_click()
if (pathsid.empty()) {
return;
}
+ bool foundOne = false;
Inkscape::SVGOStringStream os;
+ for (std::vector<PathAndDirectionAndVisible*>::const_iterator iter = _vector.begin(); iter != _vector.end(); ++iter) {
+ if (foundOne) {
+ os << "|";
+ } else {
+ foundOne = true;
+ }
+ os << (*iter)->href << "," << ((*iter)->reversed ? "1" : "0") << "," << ((*iter)->visibled ? "1" : "0");
+ }
for (auto i=pathsid.begin();i!=pathsid.end();++i) {
Glib::ustring pathid = *i;
// add '#' at start to make it an uri.
pathid.insert(pathid.begin(), '#');
- bool foundOne = false;
- for (std::vector<PathAndDirectionAndVisible*>::const_iterator iter = _vector.begin(); iter != _vector.end(); ++iter) {
- if (foundOne) {
- os << "|";
- } else {
- foundOne = true;
- }
- os << (*iter)->href << "," << ((*iter)->reversed ? "1" : "0") << "," << ((*iter)->visibled ? "1" : "0");
- }
-
+
if (foundOne) {
os << "|";
}
- os << pathid.c_str() << ",0";
- if (*i != *(--pathsid.end())) {
- os << "|";
- }
+ os << pathid.c_str() << ",0,1";
}
param_write_to_repr(os.str().c_str());
DocumentUndo::done(param_effect->getSPDoc(), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
@@ -363,7 +360,7 @@ void OriginalPathArrayParam::unlink(PathAndDirectionAndVisible* to)
if (to->href) {
g_free(to->href);
to->href = NULL;
- }
+ }
}
void OriginalPathArrayParam::remove_link(PathAndDirectionAndVisible* to)
@@ -528,6 +525,14 @@ gchar * OriginalPathArrayParam::param_getSVGValue() const
return str;
}
+void OriginalPathArrayParam::update()
+{
+ for (std::vector<PathAndDirectionAndVisible*>::iterator iter = _vector.begin(); iter != _vector.end(); ++iter) {
+ SPObject *linked_obj = (*iter)->ref.getObject();
+ linked_modified(linked_obj, SP_OBJECT_MODIFIED_FLAG, *iter);
+ }
+}
+
} /* namespace LivePathEffect */
} /* namespace Inkscape */
diff --git a/src/live_effects/parameter/originalpatharray.h b/src/live_effects/parameter/originalpatharray.h
index 51810a5cf..cffa2911f 100644
--- a/src/live_effects/parameter/originalpatharray.h
+++ b/src/live_effects/parameter/originalpatharray.h
@@ -72,11 +72,11 @@ public:
virtual void param_editOncanvas(SPItem * /*item*/, SPDesktop * /*dt*/) {};
/** Disable the canvas indicators of parent class by overriding this method */
virtual void addCanvasIndicators(SPLPEItem const* /*lpeitem*/, std::vector<Geom::PathVector> & /*hp_vec*/) {};
- void setFromOriginalD(bool from_original_d){ _from_original_d = from_original_d; };
- void allowOnlyBsplineSpiro(bool allow_only_bspline_spiro){ _allow_only_bspline_spiro = allow_only_bspline_spiro; };
+ void setFromOriginalD(bool from_original_d){ _from_original_d = from_original_d; update();};
+ void allowOnlyBsplineSpiro(bool allow_only_bspline_spiro){ _allow_only_bspline_spiro = allow_only_bspline_spiro; update();};
std::vector<PathAndDirectionAndVisible*> _vector;
-
+
protected:
bool _updateLink(const Gtk::TreeIter& iter, PathAndDirectionAndVisible* pd);
bool _selectIndex(const Gtk::TreeIter& iter, int* i);
@@ -108,6 +108,7 @@ protected:
private:
bool _from_original_d;
bool _allow_only_bspline_spiro;
+ void update();
OriginalPathArrayParam(const OriginalPathArrayParam&);
OriginalPathArrayParam& operator=(const OriginalPathArrayParam&);
};