aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-05-18 00:10:46 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-05-18 00:10:46 +0200
commitbe6484b1e9e0d14cdb1523f5771921d637a1bb50 (patch)
tree7a81330d0e2de908591c2121a74034203bbe6527
parente31c05cc4c784d0824315098c9066711c9c6d66e (diff)
minor
-rw-r--r--units.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/units.go b/units.go
index 81e48c7..726829d 100644
--- a/units.go
+++ b/units.go
@@ -34,12 +34,14 @@ type Point struct {
var orientation = Portrait
-func (p Point) String() string {
- if orientation == Portrait {
- return fmt.Sprintf("%v,%v", p.X, p.Y)
- } else {
- return fmt.Sprintf("%v,%v", p.Y, p.X)
+func (p Point) String() (s string) {
+ switch orientation {
+ case Portrait:
+ s = fmt.Sprintf("%v,%v", p.X, p.Y)
+ case Landscape:
+ s = fmt.Sprintf("%v,%v", p.Y, p.X)
}
+ return
}
func parsePoint(s string) (p Point) {