##// END OF EJS Templates
Fix validate logic if min/max are changed
Gordon Ball -
Show More
@@ -78,9 +78,11 b' class _BoundedFloatRangeWidget(_FloatRangeWidget):'
78 """Validate min <= low <= high <= max"""
78 """Validate min <= low <= high <= max"""
79 if name == "value":
79 if name == "value":
80 low, high = new
80 low, high = new
81 low = max(low, self.min)
81 else:
82 high = min(high, self.max)
82 low, high = self.value
83 self.value = (min(low, high), max(low, high))
83 low = max(low, self.min)
84 high = min(high, self.max)
85 self.value = (min(low, high), max(low, high))
84
86
85
87
86 class FloatRangeSliderWidget(_BoundedFloatRangeWidget):
88 class FloatRangeSliderWidget(_BoundedFloatRangeWidget):
@@ -77,9 +77,11 b' class _BoundedIntRangeWidget(_IntRangeWidget):'
77 """Validate min <= low <= high <= max"""
77 """Validate min <= low <= high <= max"""
78 if name == "value":
78 if name == "value":
79 low, high = new
79 low, high = new
80 low = max(low, self.min)
80 else:
81 high = min(high, self.max)
81 low, high = self.value
82 self.value = (min(low, high), max(low, high))
82 low = max(low, self.min)
83 high = min(high, self.max)
84 self.value = (min(low, high), max(low, high))
83
85
84
86
85 class IntRangeSliderWidget(_BoundedIntRangeWidget):
87 class IntRangeSliderWidget(_BoundedIntRangeWidget):
General Comments 0
You need to be logged in to leave comments. Login now