Added documentation for the sliders
This commit is contained in:
parent
d7a6193c04
commit
7f1c3ae870
@ -7,12 +7,16 @@ type Numeric interface {
|
|||||||
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
|
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LerpSlider is a slider that has a minimum and maximum value, and who's value
|
||||||
|
// can be any numeric type.
|
||||||
type LerpSlider[T Numeric] struct {
|
type LerpSlider[T Numeric] struct {
|
||||||
*Slider
|
*Slider
|
||||||
min T
|
min T
|
||||||
max T
|
max T
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewLerpSlider creates a new LerpSlider with a minimum and maximum value. If
|
||||||
|
// vertical is set to true, the slider will be vertical instead of horizontal.
|
||||||
func NewLerpSlider[T Numeric] (min, max T, value T, vertical bool) (element *LerpSlider[T]) {
|
func NewLerpSlider[T Numeric] (min, max T, value T, vertical bool) (element *LerpSlider[T]) {
|
||||||
if min > max {
|
if min > max {
|
||||||
temp := max
|
temp := max
|
||||||