[][src]Type Definition byteplug::widget::CursorMoveFunction

type CursorMoveFunction<Window, States> = fn(window: &mut Window, position: Position, movement: Vector, states: &mut States);

The cursor move callback function

This function is called whenever the mouse cursor moves while it is on the widget area, or when the widget is grabbed. It's called with the position of the cursor relative to the widget top-left corner and a vector describing the cursor movement in pixels coordinate.

  • position - The new cursor position (relative to the top-left corner).
  • movement - The movement of the cursor in pixels coordinate.