dev (#297)
All checks were successful
Build AppImage / Explore-Gitea-Actions (push) Successful in 2m35s
All checks were successful
Build AppImage / Explore-Gitea-Actions (push) Successful in 2m35s
this time it will not break! Co-authored-by: Dominik Demuth <dominik.demuth@physik.tu-darmstadt.de> Reviewed-on: #297
This commit was merged in pull request #297.
This commit is contained in:
@@ -539,6 +539,10 @@ class QGraphWindow(QtWidgets.QGraphicsView, Ui_GraphWindow):
|
||||
|
||||
if self.graphic.plotItem.sceneBoundingRect().contains(evt.scenePos()) and evt.button() == 1:
|
||||
pos = vb.mapSceneToView(evt.scenePos())
|
||||
|
||||
if not _inside_range(pos.x(), pos.y(), vb.viewRange()):
|
||||
return
|
||||
|
||||
_x, _y = pos.x(), pos.y()
|
||||
|
||||
if self.log[0]:
|
||||
@@ -854,3 +858,7 @@ class QGraphWindow(QtWidgets.QGraphicsView, Ui_GraphWindow):
|
||||
self.set_color(foreground=self._prev_colors[0], background=self._prev_colors[1])
|
||||
self._prev_colors = temp
|
||||
|
||||
|
||||
def _inside_range(x: float, y: float, ranges: list[list[float]]) -> bool:
|
||||
x_range, y_range = ranges
|
||||
return (x_range[0] <= x <= x_range[1]) and (y_range[0] <= y <= y_range[1])
|
||||
Reference in New Issue
Block a user