summaryrefslogtreecommitdiff
path: root/tui/geometry.go
diff options
context:
space:
mode:
authorcitrons <citrons@mondecitronne.com>2025-05-31 17:16:38 -0500
committercitrons <citrons@mondecitronne.com>2025-05-31 17:16:57 -0500
commitb11c892158772f508e494b2726a5d4db1bb74d23 (patch)
tree16113353422520259ccc7937e9085a68ac6663a6 /tui/geometry.go
parent0a58e68ad438ff43fa5bbecdb8914aa00cab5099 (diff)
text input box
Diffstat (limited to 'tui/geometry.go')
-rw-r--r--tui/geometry.go32
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