From 4607fa0f9f7bd0a3361af37ea4ed0a99ae1791a5 Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Wed, 14 Jan 2026 10:57:17 +0800 Subject: [PATCH] scientific_spinbox: fix stepBy ignoring precision --- artiq/gui/scientific_spinbox.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/artiq/gui/scientific_spinbox.py b/artiq/gui/scientific_spinbox.py index 7faedae026..ccf577544b 100644 --- a/artiq/gui/scientific_spinbox.py +++ b/artiq/gui/scientific_spinbox.py @@ -77,7 +77,10 @@ def validate(self, text, pos): def stepBy(self, s): if abs(s) < 10: # unaccelerated buttons, keys, wheel/trackpad - super().stepBy(s) + v = self.value() + v += s * self.singleStep() + v = round(v, self.decimals()) + self.setValue(v) else: # accelerated PageUp/Down or CTRL-wheel v = self.value() v *= self._relative_step**(s/copysign(10., v))