Added mouse-tracking for rectangle selection.