/** * Finds the Interactive located at the specified pixel position. * * @param panel the drawing panel * @param xpix the x pixel position * @param ypix the y pixel position * @return the TPoint that is hit, or null */ public Interactive findInteractive(DrawingPanel panel, int xpix, int ypix) { boolean highlighted = (track.trackerPanel.getFrameNumber() == getFrameNumber()); AutoTracker autoTracker = track.trackerPanel.getAutoTracker(); TrackerPanel trackerPanel = (TrackerPanel) panel; setHitRectCenter(xpix, ypix); for (int i = 0; i < points.length; i++) { if (points[i] == null || Double.isNaN(points[i].getX())) continue; if (hitRect.contains(points[i].getScreenPosition(trackerPanel))) { if (highlighted && autoTracker.isDrawingKeyFrameFor(track, i)) return null; return points[i]; } } return null; }