Fixed bug in slider when maximum equal to or less than the minimum was supplied.
This commit is contained in:
parent
dbeacc3794
commit
7aa88e2dc6
@ -90,7 +90,10 @@ func (s *Slider) Arrange(ctx Context, bounds geom.RectangleF32, offset geom.Poin
|
|||||||
start, length, center := s.offsets()
|
start, length, center := s.offsets()
|
||||||
w := s.handleWidth
|
w := s.handleWidth
|
||||||
w05 := .5 * w
|
w05 := .5 * w
|
||||||
handleOffset := (s.Value - s.Minimum) / (s.Maximum - s.Minimum)
|
var handleOffset float32
|
||||||
|
if s.Maximum > s.Minimum {
|
||||||
|
handleOffset = (s.Value - s.Minimum) / (s.Maximum - s.Minimum)
|
||||||
|
}
|
||||||
if !geom.IsNaN32(handleOffset) {
|
if !geom.IsNaN32(handleOffset) {
|
||||||
start += handleOffset * length
|
start += handleOffset * length
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user