function figObj = enddrag(figObj)
%FIGOBJ/ENDDRAG

%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 1.6 $  $Date: 1998/10/21 21:45:27 $

dragBin = figObj.DragObjects;
for aObjH = fliplr(dragBin.Items);
   enddrag(aObjH);
end

% restore 
HG = get(figObj,'MyHGHandle');
set(HG,'pointer','arrow',...
        'WindowButtonMotionFcn','',...
        'WindowButtonUpFcn',''...
        );
if isappdata(HG,'ScribeSaveFigUnits')
   oldUnits = getappdata(HG,'ScribeSaveFigUnits');
   if ~isempty(oldUnits)
      set(HG,'Units',oldUnits);
   end
   rmappdata(HG,'ScribeSaveFigUnits');
end