@@ -608,12 +608,13 @@ def __init__(
608608 super ().__init__ (ax , orientation , closedmin , closedmax ,
609609 valmin , valmax , valfmt , dragging , valstep )
610610
611+ # Set a value to allow _value_in_bounds() to work.
612+ self .val = [valmin , valmax ]
611613 if valinit is None :
612614 # Place at the 25th and 75th percentiles
613615 extent = valmax - valmin
614- valinit = np .array (
615- [valmin + extent * 0.25 , valmin + extent * 0.75 ]
616- )
616+ valinit = np .array ([valmin + extent * 0.25 ,
617+ valmin + extent * 0.75 ])
617618 else :
618619 valinit = self ._value_in_bounds (valinit )
619620 self .val = valinit
@@ -684,8 +685,9 @@ def _max_in_bounds(self, max):
684685 max = self .val [0 ]
685686 return self ._stepped_value (max )
686687
687- def _value_in_bounds (self , val ):
688- return (self ._min_in_bounds (val [0 ]), self ._max_in_bounds (val [1 ]))
688+ def _value_in_bounds (self , vals ):
689+ """Clip min, max values to the bounds."""
690+ return (self ._min_in_bounds (vals [0 ]), self ._max_in_bounds (vals [1 ]))
689691
690692 def _update_val_from_pos (self , pos ):
691693 """Update the slider value based on a given position."""
0 commit comments