We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1dd6dae commit 4acbbd7Copy full SHA for 4acbbd7
widget.go
@@ -5,6 +5,7 @@ package debugui
5
6
import (
7
"image"
8
+ "slices"
9
)
10
11
// WidgetID is a unique identifier for a widget.
@@ -32,18 +33,9 @@ const (
32
33
optionExpanded
34
35
-func (c *Context) inHoverRoot() bool {
36
- for i := len(c.containerStack) - 1; i >= 0; i-- {
37
- if c.containerStack[i] == c.hoverRoot {
38
- return true
39
- }
40
41
- return false
42
-}
43
-
44
func (c *Context) pointingOver(bounds image.Rectangle) bool {
45
p := c.pointingPosition()
46
- return p.In(bounds) && p.In(c.clipRect()) && c.inHoverRoot()
+ return p.In(bounds) && p.In(c.clipRect()) && slices.Contains(c.containerStack, c.hoverRoot)
47
}
48
49
func (c *Context) pointingDelta() image.Point {
0 commit comments