diff options
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 |
