diff options
| author | citrons <citrons@mondecitronne.com> | 2025-05-31 17:16:38 -0500 |
|---|---|---|
| committer | citrons <citrons@mondecitronne.com> | 2025-05-31 17:16:57 -0500 |
| commit | b11c892158772f508e494b2726a5d4db1bb74d23 (patch) | |
| tree | 16113353422520259ccc7937e9085a68ac6663a6 /tui/geometry.go | |
| parent | 0a58e68ad438ff43fa5bbecdb8914aa00cab5099 (diff) | |
text input box
Diffstat (limited to 'tui/geometry.go')
| -rw-r--r-- | tui/geometry.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tui/geometry.go b/tui/geometry.go new file mode 100644 index 0000000..b20960b --- /dev/null +++ b/tui/geometry.go @@ -0,0 +1,32 @@ +package tui + +type Direction int +const ( + Down = iota + Up + Right + Left +) + +func (d Direction) axis() int { + switch d { + case Down, Up: + return 1 + default: + return 0 + } +} + +func (d Direction) reverse() bool { + switch d { + case Down, Right: + return false + default: + return true + } +} + +type rect struct { + min [2]int + max [2]int +}
\ No newline at end of file |
