aboutsummaryrefslogtreecommitdiffstats
path: root/constraint.go
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2026-03-02 17:38:55 -0500
committerSam Anthony <sam@samanthony.xyz>2026-03-02 17:38:55 -0500
commit8858a54b5ddb3a2d8a42ecb1a837c02800bc934f (patch)
tree2428c445936eb8865c0b7c8f52560e97a44082f3 /constraint.go
parentc6cd37a6b80d4e5ad1dbf8c8968b818811b8aa54 (diff)
downloadgui-8858a54b5ddb3a2d8a42ecb1a837c02800bc934f.zip
create lay/strain package
The lay/strain package uses the Cassowary algorithm to solve systems of layout constraints.
Diffstat (limited to 'constraint.go')
-rw-r--r--constraint.go34
1 files changed, 0 insertions, 34 deletions
diff --git a/constraint.go b/constraint.go
deleted file mode 100644
index c08e222..0000000
--- a/constraint.go
+++ /dev/null
@@ -1,34 +0,0 @@
-package gui
-
-// Constraint imposes a restriction on the size of a widget or layout.
-type Constraint struct {
- // Dim is the dimension to constrain: width/height.
- Dim
-
- // Relation declares whether the constraint is an upper, lower, or exact bound.
- Relation
-
- // Length is the target or threshold value.
- Length
-}
-
-// Dim is a dimension of a widget or layout that can be constrained.
-type Dim int
-
-const (
- _ Dim = iota
- Width
- Height
-)
-
-// Relation is an (in)equality.
-type Relation int
-
-const (
- _ Relation = iota
- Eq // ==
- Gteq // >=
- Gt // >
- Lteq // <=
- Lt // <
-)