From 996d747d451b83f7e914f05e1df2895582ef5f8a Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Fri, 17 May 2024 15:36:49 -0400 Subject: [PATCH] Remedy #4 --- containerbox.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 {