function [iPoints, aObj] = selectpoints(aObj, X,Y, pointX, pointY);
%EDITLINE/SELECTPOINTS
%   pick points to move for dragging.

%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 1.5 $  $Date: 1997/12/06 00:40:29 $


% get nearest points
dx = X-pointX;
dy = Y-pointY;

dm = abs(dx)+abs(dy);

[sortedList, indices] = sort(dm);

if sortedList(1) < 0.02
   iPoints = indices(1);
else
   iPoints = indices;
end
