Commit bb9de13058ab030d8a16525a27bdece215c1360f
1 parent
03d9dea4
Exists in
master
and in
67 other branches
FIX: Deleting mask is working again
Showing
1 changed file
with
10 additions
and
5 deletions
Show diff stats
invesalius/data/slice_.py
... | ... | @@ -128,15 +128,20 @@ class Slice(object): |
128 | 128 | |
129 | 129 | def OnRemoveMasks(self, pubsub_evt): |
130 | 130 | selected_items = pubsub_evt.data |
131 | - | |
132 | 131 | proj = Project() |
133 | 132 | for item in selected_items: |
134 | 133 | proj.RemoveMask(item) |
135 | 134 | |
136 | - if not proj.mask_dict: | |
137 | - self.blend_filter.SetOpacity(1, 0) | |
138 | - self.blend_filter.Update() | |
139 | - ps.Publisher().sendMessage('Update slice viewer') | |
135 | + # if the deleted mask is the current mask, cleans the current mask | |
136 | + # and discard from buffer all datas related to mask. | |
137 | + if self.current_mask is not None and item == self.current_mask.index: | |
138 | + self.current_mask = None | |
139 | + | |
140 | + for buffer_ in self.buffer_slices.values(): | |
141 | + buffer_.discard_vtk_mask() | |
142 | + buffer_.discard_mask() | |
143 | + | |
144 | + ps.Publisher().sendMessage('Reload actual slice') | |
140 | 145 | |
141 | 146 | def OnDuplicateMasks(self, pubsub_evt): |
142 | 147 | selected_items = pubsub_evt.data | ... | ... |