Mercurial > MadButterfly
changeset 1170:e64b02951627
Fix the issue in the normal tween. We duplicate the object only when the object is not in the duplicated node yet.
author | wycc |
---|---|
date | Thu, 30 Dec 2010 11:30:16 +0800 |
parents | ac5f960ba6cf |
children | 16ea7b81eda8 |
files | pyink/tween.py |
diffstat | 1 files changed, 14 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/pyink/tween.py Thu Dec 30 11:12:34 2010 +0800 +++ b/pyink/tween.py Thu Dec 30 11:30:16 2010 +0800 @@ -63,12 +63,12 @@ pass # Remove duplicate nodes that is not in the set of stop nodes - for node_ref in dup_nodes: - if node_ref not in stop_nodes: - node = dup_nodes[node_ref] - duplicate_group.removeChild(node) - pass - pass + #for node_ref in dup_nodes: + # if node_ref not in stop_nodes: + # node = dup_nodes[node_ref] + # duplicate_group.removeChild(node) + # pass + # pass # # Node ID of a node of start scene must be mapped to @@ -87,9 +87,9 @@ try: stop_node = stop_nodes[start_node_id] except KeyError: - #self.updateTweenObject(duplicate_group, tween_type, - # start_node, start_node, - # percent, dup_node) + self.updateTweenObject(duplicate_group, tween_type, + start_node, start_node, + percent, dup_node) start_node = start_node.next() continue @@ -176,11 +176,10 @@ self.updateTweenObjectScale(obj,s,d,p,newobj) pass elif typ == self.TWEEN_TYPE_NORMAL: - newobj = s.duplicate(self.document) - newobj.setAttribute("ref", s.getAttribute("id")) - top = self.document.createElement("svg:g") - top.appendChild(newobj) - obj.appendChild(top) + if newobj == None: + newobj = s.duplicate(self.document) + newobj.setAttribute("ref", s.getAttribute("id")) + obj.appendChild(newobj) pass def updateTweenObjectScale(self,obj,s,d,p,newobj): @@ -196,9 +195,9 @@ newobj = s.duplicate(self.document) top = self.document.createElement("svg:g") top.setAttribute("ref",s.getAttribute("id")) - top.setAttribute("inkscape:label","dup") top.appendChild(newobj) obj.appendChild(top) + print "aaa" else: top = newobj newobj = top.firstChild()