Skip to content

Commit

Permalink
properly sort docking indicator draw commands
Browse files Browse the repository at this point in the history
  • Loading branch information
aarzilli committed Jul 10, 2018
1 parent d717573 commit d63a2d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ type context struct {
trashFrame bool
autopos image.Point

finalCmds command.Buffer

dockedWindowFocus int
floatWindowFocus int
scrollwheelFocus int
Expand All @@ -48,6 +50,7 @@ func contextAllCommands(ctx *context) {
})
}
}
ctx.cmds = append(ctx.cmds, ctx.finalCmds.Commands...)
return
}

Expand Down Expand Up @@ -114,6 +117,7 @@ func contextBegin(ctx *context, layout *panel) {
w.widgets.reset()
w.cmds.Reset()
}
ctx.finalCmds.Reset()
ctx.DockedWindows.Walk(func(w *Window) *Window {
w.usingSub = false
w.curNode = w.rootNode
Expand Down
4 changes: 2 additions & 2 deletions nucular.go
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ func (win *Window) move(delta image.Point, pos image.Point) {
return
}
if canDock, bounds := win.ctx.DockedWindows.Dock(nil, pos, win.ctx.Windows[0].Bounds, win.ctx.Style.Scaling); canDock {
win.cmds.FillRect(bounds, 0, color.RGBA{0x0, 0x0, 0x50, 0x50})
win.ctx.finalCmds.FillRect(bounds, 0, color.RGBA{0x0, 0x0, 0x50, 0x50})
}
win.Bounds.X = win.Bounds.X + delta.X
win.Bounds.X = clampInt(0, win.Bounds.X, win.ctx.Windows[0].Bounds.X+win.ctx.Windows[0].Bounds.W-FontHeight(win.ctx.Style.Font))
Expand Down Expand Up @@ -1440,7 +1440,7 @@ func (win *Window) TreePushCustom(type_ TreeType, name string, initial_open bool
styleButton = &style.Tab.TabButton
}
doButton(win, label.S(symbolType), sym, styleButton, in, false)

out = &win.cmds
if !widget_state {
out = nil
Expand Down

0 comments on commit d63a2d6

Please sign in to comment.