blob: 44c9e0a051121551aadd15c97de02c5d948f424d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
package strain
import (
"github.com/lithdew/casso"
"golang.org/x/exp/shiny/unit"
)
// Constraint imposes a restriction on the size of a widget or layout.
type Constraint struct {
// Dimension is the dimension to constrain: width/height.
Dimension
// Relation declares whether the constraint is an upper, lower,
// or exact bound.
casso.Op
// Value is the target or threshold value.
unit.Value
}
// Dim is a dimension of a widget or layout that can be constrained.
type Dimension int
const (
_ Dimension = iota
Width
Height
)
|