diff options
author | Colin Okay <colin@cicadas.surf> | 2022-07-06 09:51:13 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-07-06 09:51:13 -0500 |
commit | 76fa9bbd852fdb2d47c8cf3d539da805bd2f9b53 (patch) | |
tree | 0d4913bfd6a10bb175cdf497e152b80f958ce8fd /src/wheelwork.lisp | |
parent | 827dadbc91abdb8e2143c2a15b996e0e5ad87fc6 (diff) |
[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.
Diffstat (limited to 'src/wheelwork.lisp')
-rw-r--r-- | src/wheelwork.lisp | 6 |
1 files changed, 2 insertions, 4 deletions
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))))))) |