zntg/ui/fixed.go
Sander Schobers 3ea0d76efb Created unified spacing control.
Build control methods now accept nil as visitor method.
2019-03-12 21:11:43 +01:00

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)
})
}