diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2016-11-05 13:49:05 +0000 |
|---|---|---|
| committer | jabiertxof <info@marker.es> | 2016-11-05 13:49:05 +0000 |
| commit | e7eeaf23639692c87f9cd772b8cdbfb7e54ceea6 (patch) | |
| tree | b543fc853e56ef3ec4ecf09c46ee8077012c909c | |
| parent | Fix change between multiples LPE in the same item (diff) | |
| download | inkscape-e7eeaf23639692c87f9cd772b8cdbfb7e54ceea6.tar.gz inkscape-e7eeaf23639692c87f9cd772b8cdbfb7e54ceea6.zip | |
Fix a bug on duplicate item with multiples LPE on it. previously the LPE become "clones" if more than 1 LPE on the item.
Also wee need to discuss what happends on LPE copied what are inside a group, fork them or clone, currently are cloned
This can be a feature or a bug in the same user with diferent works. My proposal is fork it and add a item in paste LPEs to allow cloned LPE on paste
(bzr r15213)
| -rw-r--r-- | src/ui/clipboard.cpp | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index 0a671cc8a..ef00e11b3 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -688,7 +688,23 @@ void ClipboardManagerImpl::_copySelection(ObjectSet *selection) else obj_copy = _copyNode(obj, _doc, _clipnode); - + // For lpe items, copy lpe stack if applicable + SPLPEItem *lpeitem = dynamic_cast<SPLPEItem *>(item); + if (lpeitem) { + Inkscape::SVGOStringStream os; + if (lpeitem->hasPathEffect()) { + for (PathEffectList::iterator it = lpeitem->path_effect_list->begin(); it != lpeitem->path_effect_list->end(); ++it) + { + LivePathEffectObject *lpeobj = (*it)->lpeobject; + if (lpeobj) { + Inkscape::XML::Node * lpeobjcopy = _copyNode(lpeobj->getRepr(), _doc, _defs); + lpeobjcopy->setAttribute("id",lpeobj->getRepr()->attribute("id")); + os << "#" << lpeobj->getRepr()->attribute("id") << ";"; + } + } + } + obj_copy->setAttribute("inkscape:path-effect", os.str().c_str()); + } // copy complete inherited style SPCSSAttr *css = sp_repr_css_attr_inherited(obj, "style"); sp_repr_css_set(obj_copy, css, "style"); @@ -720,14 +736,6 @@ void ClipboardManagerImpl::_copySelection(ObjectSet *selection) sp_repr_css_set(_clipnode, style, "style"); sp_repr_css_attr_unref(style); } - - // copy path effect from the first path - if (object) { - gchar const *effect =object->getRepr()->attribute("inkscape:path-effect"); - if (effect) { - _clipnode->setAttribute("inkscape:path-effect", effect); - } - } } Geom::OptRect size = selection->visualBounds(); @@ -784,20 +792,6 @@ void ClipboardManagerImpl::_copyUsedDefs(SPItem *item) } } - // For lpe items, copy lpe stack if applicable - SPLPEItem *lpeitem = dynamic_cast<SPLPEItem *>(item); - if (lpeitem) { - if (lpeitem->hasPathEffect()) { - for (PathEffectList::iterator it = lpeitem->path_effect_list->begin(); it != lpeitem->path_effect_list->end(); ++it) - { - LivePathEffectObject *lpeobj = (*it)->lpeobject; - if (lpeobj) { - _copyNode(lpeobj->getRepr(), _doc, _defs); - } - } - } - } - // For 3D boxes, copy perspectives { SPBox3D *box = dynamic_cast<SPBox3D *>(item); |
