Changeset 187 for trunk/src/mouse_down.m


Ignore:
Timestamp:
Feb 1, 2011, 1:07:28 AM (13 years ago)
Author:
sommeria
Message:

various bug repairs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mouse_down.m

    r177 r187  
    3030hhuvmat=guidata(huvmat);%handles of elements in uvmat
    3131UvData=get(huvmat,'UserData');
    32 currentfig=hObject;
    33 hhcurrentfig=guidata(currentfig);
     32FigData=get(hObject,'UserData');
     33if ishandle(FigData)% case of a zoom plot, the handle of the parent rectangle is stored in UserData, its parent is the plotting axes of the rectangle
     34    hcurrentfig=get(get(FigData,'parent'),'parent');
     35else
     36    hcurrentfig=hObject;%usual plot
     37end
     38hhcurrentfig=guidata(hcurrentfig);
    3439test_zoom=get(hhcurrentfig.zoom,'Value');%test for zoom action, first priority
    3540test_ruler=isequal(get(hhuvmat.MenuRuler,'checked'),'on');%test for ruler  action, second priority;
     
    5863%% determine the currently selected items
    5964hcurrentobject=gco;% current object handle (selected by the mouse)
    60 hcurrentfig=hObject;% current figure handle
     65%hcurrentfig=hObject;% current figure handle
    6166fig_tag=get(hcurrentfig,'Tag');
    6267tag_obj=get(gco,'Tag');%tag of the currently selected object
    6368xy=[];%default
    64 xy_fig=get(hcurrentfig,'CurrentPoint');% current point of the current figure (gcbo)
    65 hchild=get(hcurrentfig,'Children');%handles of all objects in the current figure
     69xy_fig=get(hObject,'CurrentPoint');% current point of the current figure (gcbo)
     70hchild=get(hObject,'Children');%handles of all objects in the current figure
    6671haxes=[];
    6772
     
    106111    end
    107112end
    108 test2D=0;
    109 if isfield(AxeData,'NbDim')
    110     if isequal(AxeData.NbDim,2)
    111         test2D=1;
    112     end
    113 end
    114 if ~test2D     %desable  object creation and vector editing if NbDim different from 2
     113
     114%% desable  object creation and vector editing if NbDim different from 2
     115if ~(isfield(AxeData,'NbDim') && isequal(AxeData.NbDim,2))
    115116    test_create=0;
    116     test_edit_vect=0;
    117 end
    118 %delete the current zoom rectangle
     117    test_edit_vect=0;   
     118end
     119
     120%% delete the current zoom rectangle
    119121if isfield(AxeData,'CurrentRectZoom') & ishandle(AxeData.CurrentRectZoom)
    120122    delete(AxeData.CurrentRectZoom)
Note: See TracChangeset for help on using the changeset viewer.