This repository has been archived by the owner on Dec 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 101
/
Scroll.go
50 lines (41 loc) · 1.54 KB
/
Scroll.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package imgui
// #include "wrapper/Scroll.h"
import "C"
// ScrollX returns the horizontal scrolling amount [0..GetScrollMaxX()].
func ScrollX() float32 {
return float32(C.iggGetScrollX())
}
// ScrollY returns the vertical scrolling amount [0..GetScrollMaxY()].
func ScrollY() float32 {
return float32(C.iggGetScrollY())
}
// ScrollMaxX returns the maximum horizontal scrolling amount: ContentSize.X - WindowSize.X .
func ScrollMaxX() float32 {
return float32(C.iggGetScrollMaxX())
}
// ScrollMaxY returns the maximum vertical scrolling amount: ContentSize.Y - WindowSize.Y .
func ScrollMaxY() float32 {
return float32(C.iggGetScrollMaxY())
}
// SetScrollHereX adjusts horizontal scrolling amount to make current cursor
// position visible. ratio=0.0: left, 0.5: center, 1.0: right. When using to
// make a "default/current item" visible, consider using SetItemDefaultFocus()
// instead.
func SetScrollHereX(ratio float32) {
C.iggSetScrollHereX(C.float(ratio))
}
// SetScrollHereY adjusts vertical scrolling amount to make current cursor
// position visible. ratio=0.0: top, 0.5: center, 1.0: bottom. When using to
// make a "default/current item" visible, consider using SetItemDefaultFocus()
// instead.
func SetScrollHereY(ratio float32) {
C.iggSetScrollHereY(C.float(ratio))
}
// SetScrollX sets horizontal scrolling amount [0 .. ScrollMaxX()].
func SetScrollX(scrollX float32) {
C.iggSetScrollX(C.float(scrollX))
}
// SetScrollY sets vertical scrolling amount [0 .. ScrollMaxY()].
func SetScrollY(scrollY float32) {
C.iggSetScrollY(C.float(scrollY))
}