From b11c892158772f508e494b2726a5d4db1bb74d23 Mon Sep 17 00:00:00 2001 From: citrons Date: Sat, 31 May 2025 17:16:38 -0500 Subject: text input box --- tui/geometry.go | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tui/geometry.go (limited to 'tui/geometry.go') 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 -- cgit v1.2.3