Trace a line from mouse or touch input