implements mouse tracking for line