mirror of
https://github.com/EyeTrackVR/EyeTrackVR.git
synced 2025-11-04 14:39:42 +08:00
Limit ROI crop to padded region
This commit is contained in:
parent
666022d0e5
commit
826afb2f30
@ -365,7 +365,11 @@ class CameraWidget:
|
|||||||
# Event for mouse button up in ROI mode
|
# Event for mouse button up in ROI mode
|
||||||
self.is_mouse_up = True
|
self.is_mouse_up = True
|
||||||
print("UP")
|
print("UP")
|
||||||
# TODO keep rect in bounds of rotated image
|
self.x0 = np.clip(self.x0, 0, self.pad_w)
|
||||||
|
self.y0 = np.clip(self.y0, 0, self.pad_h)
|
||||||
|
self.x1 = np.clip(self.x1, 0, self.pad_w)
|
||||||
|
self.y1 = np.clip(self.y1, 0, self.pad_h)
|
||||||
|
self._cartesian_to_polar()
|
||||||
if abs(self.x0 - self.x1) != 0 and abs(self.y0 - self.y1) != 0:
|
if abs(self.x0 - self.x1) != 0 and abs(self.y0 - self.y1) != 0:
|
||||||
(x0, y0), (x1, y1) = self._polar_to_cartesian_at_angle(0)
|
(x0, y0), (x1, y1) = self._polar_to_cartesian_at_angle(0)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user