diff options
| author | Pietro Gagliardi <[email protected]> | 2016-01-24 21:50:59 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2016-01-24 21:50:59 -0500 |
| commit | 439f3f476c2b8fa2bd51bbb6257c3bf7c1208254 (patch) | |
| tree | 80674546e240b69365180199f83bd253ed1180bb /area.go | |
| parent | 4dbaec8aa189f7a66209bbad351c44f1a38160be (diff) | |
Added Area.ScrollTo().
Diffstat (limited to 'area.go')
| -rw-r--r-- | area.go | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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)) +} |
