@@ -153,6 +153,9 @@ def __init__(
153
153
# ROI
154
154
self ._roi : PRoiHandle | None = None
155
155
156
+ # closest data point under the mouse
157
+ self ._data_coords : tuple [int , int ] = (0 , 0 )
158
+
156
159
# WIDGETS ----------------------------------------------------
157
160
158
161
# the button that controls the display mode of the channels
@@ -731,6 +734,7 @@ def _update_hover_info(self, event: QMouseEvent) -> bool:
731
734
732
735
x = int (x )
733
736
y = int (y )
737
+ self ._data_coords = (x , y )
734
738
text = f"[{ y } , { x } ]"
735
739
# TODO: Can we use self._canvas.elements_at?
736
740
for n , handles in enumerate (self ._img_handles .values ()):
@@ -765,6 +769,11 @@ def keyPressEvent(self, a0: QKeyEvent | None) -> None:
765
769
if a0 .key () == Qt .Key .Key_Delete and self ._selection is not None :
766
770
self ._selection .remove ()
767
771
self ._selection = None
772
+ elif a0 .key () in [Qt .Key .Key_Plus , Qt .Key .Key_Equal ]:
773
+ self ._canvas ._camera .zoom (factor = 0.667 , center = self ._data_coords )
774
+ elif a0 .key () in [Qt .Key .Key_Minus , Qt .Key .Key_Underscore ]:
775
+ self ._canvas ._camera .zoom (factor = 1.5 , center = self ._data_coords )
776
+
768
777
769
778
def _update_roi_button (self , event : QMouseEvent ) -> bool :
770
779
if self ._add_roi_btn .isChecked ():
0 commit comments