Commit f2173679057ff01256ac322ceebdb94024ba2d24
1 parent
f4ba2289
Exists in
master
and in
3 other branches
Change mip size using numpad affects the mip config gui
Showing
1 changed file
with
9 additions
and
6 deletions
Show diff stats
invesalius/data/viewer_slice.py
... | ... | @@ -1158,14 +1158,17 @@ class Viewer(wx.Panel): |
1158 | 1158 | self.OnScrollBar() |
1159 | 1159 | |
1160 | 1160 | elif (evt.GetKeyCode() == wx.WXK_NUMPAD_ADD): |
1161 | - self.number_slices += 1 | |
1162 | - print "ADDing", self.number_slices | |
1163 | - self.ReloadActualSlice() | |
1161 | + actual_value = self.mip_ctrls.mip_size_spin.GetValue() | |
1162 | + self.mip_ctrls.mip_size_spin.SetValue(actual_value + 1) | |
1163 | + if self.mip_ctrls.mip_size_spin.GetValue() != actual_value: | |
1164 | + self.number_slices = self.mip_ctrls.mip_size_spin.GetValue() | |
1165 | + self.ReloadActualSlice() | |
1164 | 1166 | |
1165 | 1167 | elif (evt.GetKeyCode() == wx.WXK_NUMPAD_SUBTRACT): |
1166 | - if self.number_slices > 1: | |
1167 | - self.number_slices -= 1 | |
1168 | - print "Subtracting", self.number_slices | |
1168 | + actual_value = self.mip_ctrls.mip_size_spin.GetValue() | |
1169 | + self.mip_ctrls.mip_size_spin.SetValue(actual_value - 1) | |
1170 | + if self.mip_ctrls.mip_size_spin.GetValue() != actual_value: | |
1171 | + self.number_slices = self.mip_ctrls.mip_size_spin.GetValue() | |
1169 | 1172 | self.ReloadActualSlice() |
1170 | 1173 | |
1171 | 1174 | elif evt.GetKeyCode() in projections: | ... | ... |