summaryrefslogtreecommitdiff
path: root/area.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2016-01-24 21:50:59 -0500
committerPietro Gagliardi <[email protected]>2016-01-24 21:50:59 -0500
commit439f3f476c2b8fa2bd51bbb6257c3bf7c1208254 (patch)
tree80674546e240b69365180199f83bd253ed1180bb /area.go
parent4dbaec8aa189f7a66209bbad351c44f1a38160be (diff)
Added Area.ScrollTo().
Diffstat (limited to 'area.go')
-rw-r--r--area.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/area.go b/area.go
index 4248523..358a391 100644
--- a/area.go
+++ b/area.go
@@ -142,3 +142,15 @@ func (a *Area) SetSize(width int, height int) {
func (a *Area) QueueRedrawAll() {
C.uiAreaQueueRedrawAll(a.a)
}
+
+// ScrollTo scrolls the Area to show the given rectangle; what this
+// means is implementation-defined, but you can safely assume
+// that as much of the given rectangle as possible will be visible
+// after this call. (TODO verify this on OS X) ScrollTo panics if called
+// on a non-scrolling Area.
+func (a *Area) ScrollTo(x float64, y float64, width float64, height float64) {
+ if !a.scrolling {
+ panic("attempt to call ScrollTo on non-scrolling Area")
+ }
+ C.uiAreaScrollTo(a.a, C.double(x), C.double(y), C.double(width), C.double(height))
+}