Skip to content

Commit 3dfc000

Browse files
committed
debugui: fix comments
1 parent 3b052e1 commit 3dfc000

File tree

2 files changed

+11
-33
lines changed

2 files changed

+11
-33
lines changed

command.go

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ const (
1919
commandDraw
2020
)
2121

22-
type baseCommand struct {
23-
typ int
24-
}
25-
2622
type clipCommand struct {
2723
rect image.Rectangle
2824
}
@@ -50,25 +46,24 @@ type drawCommand struct {
5046

5147
type command struct {
5248
typ int
53-
base baseCommand // type 0 (TODO)
54-
clip clipCommand // type 1
55-
rect rectCommand // type 2
56-
text textCommand // type 3
57-
icon iconCommand // type 4
58-
draw drawCommand // type 5
49+
clip clipCommand
50+
rect rectCommand
51+
text textCommand
52+
icon iconCommand
53+
draw drawCommand
5954
}
6055

61-
// appendCommand adds a new command with type cmd_type to the command list.
56+
// appendCommand adds a new command with type cmdType to the command list.
6257
func (c *Context) appendCommand(cmdType int) *command {
6358
cmd := command{
6459
typ: cmdType,
6560
}
66-
cmd.base.typ = cmdType
6761
cnt := c.currentRootContainer()
6862
cnt.commandList = append(cnt.commandList, &cmd)
6963
return &cmd
7064
}
7165

66+
// commands returns a sequence of commands from all root containers.
7267
func (c *Context) commands() iter.Seq[*command] {
7368
return func(yield func(command *command) bool) {
7469
for _, cnt := range c.rootContainers {
@@ -78,24 +73,5 @@ func (c *Context) commands() iter.Seq[*command] {
7873
}
7974
}
8075
}
81-
/*if len(c.commandList) == 0 {
82-
return
83-
}
84-
85-
cmd := c.commandList[0]
86-
for cmd.idx < len(c.commandList) {
87-
if cmd.typ != commandJump {
88-
if !yield(cmd) {
89-
return
90-
}
91-
cmd = c.commandList[cmd.idx+1]
92-
continue
93-
}
94-
idx := cmd.jump.dstIdx
95-
if idx > len(c.commandList)-1 {
96-
return
97-
}
98-
cmd = c.commandList[idx]
99-
}*/
10076
}
10177
}

context.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,16 @@ type Context struct {
3333
idStack []WidgetID
3434

3535
// idToContainer maps widget IDs to containers.
36-
// Only unused containers are removed from this map at the end of Update.
36+
//
37+
// Unused containers are removed from this map at the end of Update.
3738
idToContainer map[WidgetID]*container
3839

3940
// rootContainers is a list of root containers.
4041
// rootContainers contains only root containers. For example, a panel is not contained.
4142
//
4243
// The order represents the z-order of the containers.
43-
// Only unused containers are removed from this list at the end of Update.
44+
//
45+
// Unused containers are removed from this list at the end of Update.
4446
rootContainers []*container
4547

4648
containerStack []*container

0 commit comments

Comments
 (0)