-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathspacing.go
More file actions
27 lines (21 loc) · 730 Bytes
/
spacing.go
File metadata and controls
27 lines (21 loc) · 730 Bytes
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
package imgui
// move content position toward the right, by indent_w, or style.IndentSpacing if indent_w <= 0
func Indent(indent_w float) {
var g = GImGui
var window = GetCurrentWindow()
if indent_w == 0 {
indent_w = g.Style.IndentSpacing
}
window.DC.Indent.x += indent_w
window.DC.CursorPos.x = window.Pos.x + window.DC.Indent.x + window.DC.ColumnsOffset.x
}
// move content position back to the left, by indent_w, or style.IndentSpacing if indent_w <= 0
func Unindent(indent_w float) {
var g = GImGui
var window = GetCurrentWindow()
if indent_w == 0 {
indent_w = g.Style.IndentSpacing
}
window.DC.Indent.x -= indent_w
window.DC.CursorPos.x = window.Pos.x + window.DC.Indent.x + window.DC.ColumnsOffset.x
}