mirror of
https://github.com/EyeTrackVR/EyeTrackVR.git
synced 2025-11-04 14:39:42 +08:00
make sure crop is not out of bounds
This commit is contained in:
parent
3525aed134
commit
3d08b8a4da
@ -225,6 +225,10 @@ class CameraWidget:
|
||||
if event == "{}+UP".format(self.gui_roi_selection):
|
||||
# Event for mouse button up in ROI mode
|
||||
self.is_mouse_up = True
|
||||
if self.x1 < 0:
|
||||
self.x1 = 0
|
||||
if self.y1 < 0:
|
||||
self.y1 = 0
|
||||
if abs(self.x0 - self.x1) != 0 and abs(self.y0 - self.y1) != 0:
|
||||
self.config.roi_window_x = min([self.x0, self.x1])
|
||||
self.config.roi_window_y = min([self.y0, self.y1])
|
||||
|
||||
Loading…
Reference in New Issue
Block a user