Fit.Events.GetPointerState().Buttons.Primary will reveal true OnMouseDown, but will return false OnMouseLeave even when button is kept down, because the event state is reset between event targets.
Looking at the code above, it seems wrong. It does not reveal the current state of the mouse buttons, it is just reset. And the Target property is not updated, meaning we won't be able to user GetPointerState() in e.g. OnMouseLeave to get the target we are leaving.
Perhaps the intention was to reset the state when leaving the document (moving the pointer outside of the viewport area) where we won't be able to detect the release of a mouse button.
In any case, event handlers should query the current state via the event argument. Introduce overload?: Fit.Events.GetPointerState(evArgs)
Fit.Events.GetPointerState().Buttons.Primary will reveal true OnMouseDown, but will return false OnMouseLeave even when button is kept down, because the event state is reset between event targets.
Looking at the code above, it seems wrong. It does not reveal the current state of the mouse buttons, it is just reset. And the Target property is not updated, meaning we won't be able to user GetPointerState() in e.g. OnMouseLeave to get the target we are leaving. Perhaps the intention was to reset the state when leaving the document (moving the pointer outside of the viewport area) where we won't be able to detect the release of a mouse button.
In any case, event handlers should query the current state via the event argument. Introduce overload?: Fit.Events.GetPointerState(evArgs)