diff --git a/containerbox.go b/containerbox.go index b4f70b3..44d1d99 100644 --- a/containerbox.go +++ b/containerbox.go @@ -329,6 +329,8 @@ func (this *containerBox) recursiveRedo () { } func (this *containerBox) boxUnder (point image.Point, category eventCategory) anyBox { + if !point.In(this.bounds) { return nil } + if !this.capture[category] { for _, box := range this.children { candidate := box.(anyBox).boxUnder(point, category) @@ -336,7 +338,7 @@ func (this *containerBox) boxUnder (point image.Point, category eventCategory) a } } - return this.box.boxUnder(point, category) + return this } func (this *containerBox) propagate (callback func (anyBox) bool) bool {