Commit cd404d9d1240b6487a19edcfd0a8be47bc2e74b5
1 parent
f2173679
Exists in
master
and in
3 other branches
checking if the new value of number_slices is different from the current
Showing
1 changed file
with
4 additions
and
3 deletions
Show diff stats
invesalius/data/viewer_slice.py
... | ... | @@ -1095,9 +1095,10 @@ class Viewer(wx.Panel): |
1095 | 1095 | |
1096 | 1096 | @number_slices.setter |
1097 | 1097 | def number_slices(self, val): |
1098 | - self._number_slices = val | |
1099 | - buffer_ = self.slice_.buffer_slices[self.orientation] | |
1100 | - buffer_.discard_buffer() | |
1098 | + if val != self._number_slices: | |
1099 | + self._number_slices = val | |
1100 | + buffer_ = self.slice_.buffer_slices[self.orientation] | |
1101 | + buffer_.discard_buffer() | |
1101 | 1102 | |
1102 | 1103 | def set_scroll_position(self, position): |
1103 | 1104 | self.scroll.SetThumbPosition(position) | ... | ... |