diff pyink/domview.py @ 1530:9e7e5f79acc6

Remove layer group from the tree when removing a layer.
author Thinker K.F. Li <thinker@codemud.net>
date Tue, 27 Sep 2011 10:45:12 +0800
parents b7d70341ee57
children
line wrap: on
line diff
--- a/pyink/domview.py	Wed Aug 31 22:30:02 2011 +0800
+++ b/pyink/domview.py	Tue Sep 27 10:45:12 2011 +0800
@@ -1740,7 +1740,7 @@
     def rm_layer(self, layer_idx):
 	layers = self._layers
 
-        layer = self._layers[layer_idx]
+        layer = layers[layer_idx]
         for scene_node in layer.scenes:
             scene_group_id = scene_node.getAttribute('ref')
             try:
@@ -1756,6 +1756,10 @@
 		pass
 	    pass
 	
+        comp_name = self.get_current_component()
+        layers_group = self._get_layers_group_of_component(comp_name)
+        layers_group.removeChild(layer.group)
+
 	del layers[layer_idx]
 
 	for idx in range(layer_idx, len(layers)):