Skip to content

Commit ebdeb1c

Browse files
committed
debugui: skip handling input and rendering widgets outside of scroll
Updates #41
1 parent c644b3e commit ebdeb1c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

widget.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,14 @@ func (c *Context) widget(id widgetID, opt option, layout func(bounds image.Recta
119119
layout(bounds)
120120
}
121121

122+
l, err := c.layout()
123+
if err != nil {
124+
return nil, err
125+
}
126+
if !l.body.Overlaps(bounds.Sub(c.currentContainer().layout.ScrollOffset)) {
127+
return nil, nil
128+
}
129+
122130
wasFocused := c.handleInputForWidget(id, bounds, opt)
123131
var e EventHandler
124132
if handleInput != nil {

0 commit comments

Comments
 (0)