Changeset 682 for trunk/src/mouse_up.m


Ignore:
Timestamp:
Sep 2, 2013, 7:44:19 PM (11 years ago)
Author:
sommeria
Message:

various bugs repaired

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mouse_up.m

    r681 r682  
    2525
    2626test_ruler=0;%default
    27 AxeData=get(gca,'UserData');
     27hcurrentaxes=get(hObject,'CurrentAxes');
     28if isempty(hcurrentaxes)
     29    return % no axes in the current figure
     30end
     31AxeData=get(hcurrentaxes,'UserData');
    2832if isfield(AxeData,'ParentAxes')% case of a zoom plot as current axis
    2933    hcurrentaxes=AxeData.ParentAxes;
     
    3337else
    3438    hcurrentfig=hObject;
    35     hcurrentaxes=gca; %store the current axes handle
    3639    testsubplot=0;
    3740end
     
    5457    return
    5558end
    56 xy=get(gca,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates
     59xy=get(hcurrentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates
    5760
    5861
     
    6063if ~isempty(huvmat) && isfield(AxeData,'Drawing') && ~isequal(AxeData.Drawing,'off') && isfield(AxeData,'CurrentObject')...
    6164        && ~isempty(AxeData.CurrentObject) && ishandle(AxeData.CurrentObject)
    62     %     xy=get(currentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates
    6365    PlotData=get(AxeData.CurrentObject,'UserData');%get data attached to the current projection object
    6466    IndexObj=PlotData.IndexObj;
     
    247249            ChildAxeData.ParentAxes=hcurrentaxes;
    248250            ChildAxeData.ParentRect=AxeData.CurrentRectZoom;%set the rectangle drawing as a 'parent' associated to the new axe
    249             %PosRect=CurrentOrigin;
    250            % xy=get(hcurrentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates
    251251            if xy(1,1)>CurrentOrigin(1)
    252252            set(AxeData.ZoomAxes,'Xlim',[CurrentOrigin(1) xy(1,1)])
     
    343343            h_ListCoord=hh_geometry_calib.ListCoord; %handles of the coordinate list
    344344            Coord=get(h_ListCoord,'Data');
    345            % data=read_geometry_calib(Coord);
    346             %         val=get(h_ListCoord,'Value');
    347           %  xy=get(hcurrentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates
    348345            Coord(index_point,4)=xy(1,1);
    349346            Coord(index_point,5)=xy(1,2);
    350347            set(h_ListCoord,'Data',Coord)
    351 %             for ipoint=1:size(Coord,1)
    352 %                 for jcoord=1:5
    353 %                     Coord_cell{ipoint,jcoord}=num2str(data.Coord(ipoint,jcoord),4);%display coordiantes with 4 digits
    354 %                 end
    355 %             end
    356 %             Tabchar=cell2tab(Coord_cell,' | ');
    357 %             Tabchar=[Tabchar ;{'......'}];
    358 %             set(h_ListCoord,'String',Tabchar)
    359348            set(hh,'XData',Coord(:,4))
    360349            set(hh,'YData',Coord(:,5))
Note: See TracChangeset for help on using the changeset viewer.