Mercurial > MadButterfly
comparison pyink/MBScene.py @ 1239:447cd3359cf2
Fix bug of mal-structured dup group
- When a user changes tween type of a tween, the structure of dup
group may not satisfy the requirement of new type.
- It causes unexpected behavior.
- It is fixed by checking structure and remove mal-structured ones.
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Mon, 10 Jan 2011 11:45:13 +0800 |
parents | 2febe4a301fa |
children | 84bcd398cccc |
comparison
equal
deleted
inserted
replaced
1238:2febe4a301fa | 1239:447cd3359cf2 |
---|---|
477 pass | 477 pass |
478 | 478 |
479 def rm_scene_node_n_group(self, scene_node): | 479 def rm_scene_node_n_group(self, scene_node): |
480 scene_group_id = scene_node.getAttribute('ref') | 480 scene_group_id = scene_node.getAttribute('ref') |
481 scene_group_node = self.get_node(scene_group_id) | 481 scene_group_node = self.get_node(scene_group_id) |
482 scene_group_node.parent.removeChild(scene_group_node) | 482 scene_group_node.parent().removeChild(scene_group_node) |
483 | 483 |
484 self._scenes_node.removeChild(scene_node) | 484 self._scenes_node.removeChild(scene_node) |
485 pass | 485 pass |
486 | 486 |
487 ## \brief Create and add a svg:g for a scene under a group for a layer. | 487 ## \brief Create and add a svg:g for a scene under a group for a layer. |
541 | 541 |
542 for layer in layers: | 542 for layer in layers: |
543 for scene_node in layer.scenes: | 543 for scene_node in layer.scenes: |
544 scene_group_id = scene_node.getAttribute('ref') | 544 scene_group_id = scene_node.getAttribute('ref') |
545 scene_group_node = self.get_node(scene_group_id) | 545 scene_group_node = self.get_node(scene_group_id) |
546 scene_group_node.parent.removeChild(scene_group_node) | 546 scene_group_node.parent().removeChild(scene_group_node) |
547 | 547 |
548 scene_node.parent.removeChild(scene_node) | 548 scene_node.parent().removeChild(scene_node) |
549 pass | 549 pass |
550 pass | 550 pass |
551 | 551 |
552 del layers[layer_idx] | 552 del layers[layer_idx] |
553 | 553 |