review fixes: package exports, hit-test safety, draw-text signature

This commit is contained in:
Hermes
2026-05-11 22:53:49 +00:00
parent 225b52a9d8
commit fafb1dae61
8 changed files with 36 additions and 92 deletions

View File

@@ -60,8 +60,10 @@ module adds:
(defun hit-test (root x y)
(labels ((recurse (node)
(when (and (slot-boundp node 'x) (slot-boundp node 'y)
(slot-boundp node 'width) (slot-boundp node 'height))
(when (and (slot-exists-p node 'x) (slot-boundp node 'x)
(slot-exists-p node 'y) (slot-boundp node 'y)
(slot-exists-p node 'width) (slot-boundp node 'width)
(slot-exists-p node 'height) (slot-boundp node 'height))
(let ((nx (slot-value node 'x))
(ny (slot-value node 'y))
(nw (slot-value node 'width))
@@ -152,8 +154,10 @@ module adds:
(is-true (typep m 'mouse-mixin))))
(def-test mouse-hit-test-point ()
"hit-test returns nil when no component has position slots bound"
(let ((obj (make-instance 'mouse-mixin)))
(is-true t))) ;; placeholder
(is-false (hit-test obj 0 0))
(is-false (hit-test obj 100 100))))
(def-test selection-set-and-get ()
(setf cl-tty.mouse::*selection* (make-selection :text "hello"))