diff --git a/layout/layout.go b/layout/layout.go index 2a6a6732..8d3a3d12 100644 --- a/layout/layout.go +++ b/layout/layout.go @@ -58,6 +58,14 @@ const ( Vertical ) +// Exact returns the Constraints with the minimum and maximum size +// set to size. +func Exact(size image.Point) Constraints { + return Constraints{ + Min: size, Max: size, + } +} + // Constrain a size so each dimension is in the range [min;max]. func (c Constraints) Constrain(size image.Point) image.Point { if min := c.Min.X; size.X < min {