dev (#295)
All checks were successful
Build AppImage / Explore-Gitea-Actions (push) Successful in 2m58s

Co-authored-by: Dominik Demuth <dominik.demuth@physik.tu-darmstadt.de>
Reviewed-on: #295
This commit was merged in pull request #295.
This commit is contained in:
2024-11-13 13:02:05 +00:00
parent 4108deb69a
commit 7145f9e3cd
9 changed files with 443 additions and 327 deletions

View File

@@ -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])