From 76fa9bbd852fdb2d47c8cf3d539da805bd2f9b53 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Wed, 6 Jul 2022 09:51:13 -0500 Subject: [bugfix] get-rect (container); [modify] contains-point-p modification to contains-point-p in order to handle events on objects in containers correctly; i.e. event doesn't fire if object is not being drawn. --- src/wheelwork.lisp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/wheelwork.lisp') diff --git a/src/wheelwork.lisp b/src/wheelwork.lisp index cc70053..8efca4e 100644 --- a/src/wheelwork.lisp +++ b/src/wheelwork.lisp @@ -65,9 +65,6 @@ TARGET is FOCUSABLEP" (sdl2:scancode sdl-keysym) (sdl2:mod-keywords (sdl2:mod-value sdl-keysym))))))) - - - (defun contains-point-p (unit px py) (let* ((pt (vec:vec px py 0.0 1.0)) @@ -95,7 +92,8 @@ TARGET is FOCUSABLEP" (when (unit-visiblep thing) (etypecase thing (container - (find-if #'finder (container-units thing) :from-end t)) + (when (contains-point-p thing x y) + (find-if #'finder (container-units thing) :from-end t))) (unit (when (contains-point-p thing x y) (return-from unit-under thing))))))) -- cgit v1.2.3