summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/jesseduffield/gocui/view.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/jesseduffield/gocui/view.go')
-rw-r--r--vendor/github.com/jesseduffield/gocui/view.go26
1 files changed, 25 insertions, 1 deletions
diff --git a/vendor/github.com/jesseduffield/gocui/view.go b/vendor/github.com/jesseduffield/gocui/view.go
index 9fc923800..4edc5a58d 100644
--- a/vendor/github.com/jesseduffield/gocui/view.go
+++ b/vendor/github.com/jesseduffield/gocui/view.go
@@ -475,9 +475,33 @@ func (v *View) SetOrigin(x, y int) error {
return nil
}
+func (v *View) SetOriginX(x int) error {
+ if x < 0 {
+ return ErrInvalidPoint
+ }
+ v.ox = x
+ return nil
+}
+
+func (v *View) SetOriginY(y int) error {
+ if y < 0 {
+ return ErrInvalidPoint
+ }
+ v.oy = y
+ return nil
+}
+
// Origin returns the origin position of the view.
func (v *View) Origin() (x, y int) {
- return v.ox, v.oy
+ return v.OriginX(), v.OriginY()
+}
+
+func (v *View) OriginX() int {
+ return v.ox
+}
+
+func (v *View) OriginY() int {
+ return v.oy
}
// SetWritePos sets the write position of the view's internal buffer.