Commit 4a7add3a2360df5320a9c7c78d49e533c61997c4
1 parent
6c0a5b4c
Exists in
interactor_style
The context menu is working again in the viewer_slice.py
Showing
1 changed file
with
4 additions
and
2 deletions
Show diff stats
invesalius/data/styles.py
... | ... | @@ -31,7 +31,7 @@ ORIENTATIONS = { |
31 | 31 | } |
32 | 32 | |
33 | 33 | class BaseImageInteractorStyle(vtk.vtkInteractorStyleImage): |
34 | - def __init__(self): | |
34 | + def __init__(self, viewer): | |
35 | 35 | self.right_pressed = False |
36 | 36 | self.left_pressed = False |
37 | 37 | |
... | ... | @@ -49,6 +49,8 @@ class BaseImageInteractorStyle(vtk.vtkInteractorStyleImage): |
49 | 49 | |
50 | 50 | def OnPressRightButton(self, evt, obj): |
51 | 51 | self.right_pressed = True |
52 | + self.viewer.last_position_mouse_move = \ | |
53 | + self.viewer.interactor.GetLastEventPosition() | |
52 | 54 | |
53 | 55 | def OnReleaseRightButton(self, evt, obj): |
54 | 56 | self.right_pressed = False |
... | ... | @@ -61,7 +63,7 @@ class DefaultInteractorStyle(BaseImageInteractorStyle): |
61 | 63 | * Change the slices with the scroll. |
62 | 64 | """ |
63 | 65 | def __init__(self, viewer): |
64 | - BaseImageInteractorStyle.__init__(self) | |
66 | + BaseImageInteractorStyle.__init__(self, viewer) | |
65 | 67 | |
66 | 68 | self.viewer = viewer |
67 | 69 | ... | ... |