Mercurial > MadButterfly
comparison pyink/MBScene.py @ 1197:8c5492b096f1
Fix bug of changing tween type
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Sun, 02 Jan 2011 21:09:35 +0800 |
parents | 42f8cee2118b |
children | 164076156e04 |
comparison
equal
deleted
inserted
replaced
1196:42f8cee2118b | 1197:8c5492b096f1 |
---|---|
477 scene_node.setAttribute("ref", scene_node.getAttribute("ref")) | 477 scene_node.setAttribute("ref", scene_node.getAttribute("ref")) |
478 scene_node.setAttribute("type", tween_type_name) | 478 scene_node.setAttribute("type", tween_type_name) |
479 pass | 479 pass |
480 pass | 480 pass |
481 | 481 |
482 # TODO: this function should be removed. | |
482 def update_scenes_of_dom(self): | 483 def update_scenes_of_dom(self): |
483 doc = self._root | 484 doc = self._root |
484 rdoc = self._doc | 485 rdoc = self._doc |
485 for node in doc.childList(): | 486 for node in doc.childList(): |
486 if node.name() == 'svg:metadata': | 487 if node.name() == 'svg:metadata': |
1093 return | 1094 return |
1094 | 1095 |
1095 if self.last_line == None: | 1096 if self.last_line == None: |
1096 return | 1097 return |
1097 frameline = self.last_line | 1098 frameline = self.last_line |
1098 idx = self.last_frame | 1099 start, end, old_tween_type = frameline.get_frame_block(self.last_frame) |
1099 i = 0 | 1100 |
1100 found = -1 | 1101 type_idx = self.tweenTypeSelector.get_active() |
1101 for start_idx, stop_idx, tween_type in frameline.get_frame_blocks(): | 1102 tween_type = MBScene._frameline_tween_types[type_idx] |
1102 if start_idx <= idx and stop_idx >= idx: | 1103 type_name = self._tween_type_names[type_idx] |
1103 n = self.tweenTypeSelector.get_active() | 1104 |
1104 new_tween_type = MBScene._frameline_tween_types[n] | 1105 frameline.tween(start, tween_type) |
1105 self.last_line.set_tween_type(start_idx, new_tween_type) | 1106 |
1106 self.update_scenes_of_dom() | 1107 scene_node = frameline.get_frame_data(start) |
1107 break | 1108 scene_node.setAttribute('type', type_name) |
1108 pass | |
1109 pass | 1109 pass |
1110 | 1110 |
1111 def addTweenTypeSelector(self,hbox): | 1111 def addTweenTypeSelector(self,hbox): |
1112 tweenbox = gtk.HBox() | 1112 tweenbox = gtk.HBox() |
1113 label = gtk.Label('Tween Type') | 1113 label = gtk.Label('Tween Type') |