aboutsummaryrefslogtreecommitdiff
path: root/units.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-05-17 23:59:44 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-05-17 23:59:44 +0200
commite31c05cc4c784d0824315098c9066711c9c6d66e (patch)
tree2dfba1cfa7104ad88b6679d9405a08a8691d9c62 /units.go
parentd29b92edd06b39aa203a6328a531a1c703aabc91 (diff)
Add orientation flip
Diffstat (limited to 'units.go')
-rw-r--r--units.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/units.go b/units.go
index 9561749..81e48c7 100644
--- a/units.go
+++ b/units.go
@@ -32,8 +32,14 @@ type Point struct {
X, Y Unit
}
+var orientation = Portrait
+
func (p Point) String() string {
- return fmt.Sprintf("%v,%v", p.X, p.Y)
+ if orientation == Portrait {
+ return fmt.Sprintf("%v,%v", p.X, p.Y)
+ } else {
+ return fmt.Sprintf("%v,%v", p.Y, p.X)
+ }
}
func parsePoint(s string) (p Point) {