forked from M-Labs/artiq
gui/scanwidget: use -inf/inf to represent absence of boundaries (consistently with QDoubleSpinbox)
This commit is contained in:
parent
765e3f0b5d
commit
3b63c39d2f
|
@ -41,7 +41,7 @@ class ScanWidget(QtWidgets.QWidget):
|
||||||
qfm.lineSpacing())
|
qfm.lineSpacing())
|
||||||
|
|
||||||
self._start, self._stop, self._num = None, None, None
|
self._start, self._stop, self._num = None, None, None
|
||||||
self._min, self._max = None, None
|
self._min, self._max = float("-inf"), float("inf")
|
||||||
self._axisView = None
|
self._axisView = None
|
||||||
self._offset, self._drag, self._rubber = None, None, None
|
self._offset, self._drag, self._rubber = None, None, None
|
||||||
|
|
||||||
|
@ -73,10 +73,8 @@ class ScanWidget(QtWidgets.QWidget):
|
||||||
def _clamp(self, v):
|
def _clamp(self, v):
|
||||||
if v is None:
|
if v is None:
|
||||||
return None
|
return None
|
||||||
if self._min is not None:
|
v = max(self._min, v)
|
||||||
v = max(self._min, v)
|
v = min(self._max, v)
|
||||||
if self._max is not None:
|
|
||||||
v = min(self._max, v)
|
|
||||||
return v
|
return v
|
||||||
|
|
||||||
def setStart(self, val):
|
def setStart(self, val):
|
||||||
|
|
Loading…
Reference in New Issue