aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--robo.go5
-rw-r--r--units.go8
2 files changed, 11 insertions, 2 deletions
diff --git a/robo.go b/robo.go
index 10b3d25..cc05226 100644
--- a/robo.go
+++ b/robo.go
@@ -172,7 +172,10 @@ const (
Landscape
)
-func (o Orientation) Orientation(c *bufio.Writer) { send(c, "FN", o) }
+func (o Orientation) Orientation(c *bufio.Writer) {
+ orientation = o
+ send(c, "FN", o)
+}
type LineStyle int
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) {