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

%   Copyright 1984-2000 The MathWorks, Inc. 
%   $Revision: 1.6 $  $Date: 2000/06/01 02:52:38 $


% 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
