Mercurial > MadButterfly
diff pyink/domview.py @ 1284:cbcb91b196fa
Use svg:use to duplicate the key frame. The current inkscape will not keep the extra attributes when we break the reference. Therefore, we may modify the inkscape directly or implemnet a break by ourself. In addition, we may need to improve the duplication to sync the new-added objects to an existed group.
author | wycc |
---|---|
date | Sat, 15 Jan 2011 02:43:20 +0800 |
parents | 1ac921a6bd9a |
children | e2d2532c3115 fb44830c8a81 |
line wrap: on
line diff
--- a/pyink/domview.py Fri Jan 14 00:39:21 2011 +0800 +++ b/pyink/domview.py Sat Jan 15 02:43:20 2011 +0800 @@ -732,15 +732,12 @@ def copy_group_children(self, src_group, dst_group): # Search for the duplicated group doc = self._doc - - dup_group = src_group.duplicate(doc) - old_nodes = _DOM_iterator(src_group) - new_nodes = _DOM_iterator(dup_group) new_gids = set() for old_node in old_nodes: old_node_id = old_node.getAttribute('id') - new_node = new_nodes.next() + new_node = doc.createElement("svg:use") + new_node.setAttribute("xlink:href",'#'+old_node_id) new_node.setAttribute('ns0:duplicate-src', old_node_id) # @@ -756,11 +753,7 @@ pass new_gids.add(gid) new_node.setAttribute('id', gid) - pass - - for child in dup_group.childList(): - dup_group.removeChild(child) # prvent from crash - dst_group.appendChild(child) + dst_group.appendChild(new_node) pass pass pass