From e31c05cc4c784d0824315098c9066711c9c6d66e Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 17 May 2015 23:59:44 +0200 Subject: Add orientation flip --- units.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'units.go') 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) { -- cgit v1.2.3