Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/controllers.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
;;; Mouse

(defparameter *current-entity* nil)
(defparameter *current-sketch* nil)

(defun propagate-to-entity (sketch f x y &rest other-args)
(loop
Expand Down Expand Up @@ -60,6 +61,13 @@ x & y are assumed to come last in the argument list."
(on-enter entity))
(call-next-method)))

(defmethod on-hover :around ((instance sketch) ix iy)
(unless (eql *current-sketch* instance)
(on-leave *current-sketch*)
(setf *current-sketch* instance)
(on-enter instance))
(call-next-method))

(defmethod kit.sdl2:mousebutton-event ((instance sketch-window) state timestamp button x y)
;; For backward compatibility.
(kit.sdl2:mousebutton-event (%sketch instance) state timestamp button x y)
Expand Down