24 lines
704 B
Go
24 lines
704 B
Go
package ui
|
|
|
|
// FixedSize wraps the supplied control to fill exactly the space specified.
|
|
func FixedSize(c Control, w, h float32) Control {
|
|
return BuildSpacing(c, func(s *Spacing) {
|
|
s.Width = Fixed(w)
|
|
s.Height = Fixed(h)
|
|
})
|
|
}
|
|
|
|
// FixedHeight wraps the supplied control to fill exactly the height specified. Width is taken from wrapped control.
|
|
func FixedHeight(c Control, h float32) Control {
|
|
return BuildSpacing(c, func(s *Spacing) {
|
|
s.Height = Fixed(h)
|
|
})
|
|
}
|
|
|
|
// FixedWidth wraps the supplied control to fill exactly the width specified. Height is taken from wrapped control.
|
|
func FixedWidth(c Control, w float32) Control {
|
|
return BuildSpacing(c, func(s *Spacing) {
|
|
s.Width = Fixed(w)
|
|
})
|
|
}
|