Ignore:
Timestamp:
Apr 13, 2021, 7:19:35 PM (3 years ago)
Author:
sommeria
Message:

various bugs repaired

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mouse_down.m

    r1093 r1098  
    115115            AxeData.CurrentOrigin=xy(1,1:2);% The current point set by the mouse becomes the current origin
    116116           
    117             if test_edit_vect 
     117            if test_edit_vect
    118118                ivec=[];
    119119                FigData=get(hCurrentGUI,'UserData');
     
    123123                    [CellInfo,NbDim,errormsg]=find_field_cells(Field);%analyse the physical fields contained in Field
    124124                    if isempty(errormsg)
    125                     for icell=1:numel(CellInfo)%look for all physical fields
    126                         if NbDim(icell)==2 % select 2D field
    127                             if  isfield(Field,'CoordMesh') && ~isempty(Field.CoordMesh)&&...
    128                                     ~isempty(CellInfo{icell}.VarIndex_coord_x) && ~isempty(CellInfo{icell}.VarIndex_coord_y)%case of unstructured data
    129                                 X=Field.(Field.ListVarName{CellInfo{icell}.VarIndex_coord_x});
    130                                 Y=Field.(Field.ListVarName{CellInfo{icell}.VarIndex_coord_y});
    131                                 flag_vec=(X<(xy(1,1)+Field.CoordMesh/4) & X>(xy(1,1)-Field.CoordMesh/4)) & ...%flagx=1 for the vectors with x position selected by the mouse
    132                                     (Y<(xy(1,2)+Field.CoordMesh/4) & Y>(xy(1,2)-Field.CoordMesh/4));%f
    133                                 ivec=find(flag_vec,1);% search the (first) selected vector index ivec
     125                        for icell=1:numel(CellInfo)%look for all physical fields
     126                            if NbDim(icell)==2 % select 2D field
     127                                if  isfield(Field,'CoordMesh') && ~isempty(Field.CoordMesh)&&...
     128                                        ~isempty(CellInfo{icell}.VarIndex_coord_x) && ~isempty(CellInfo{icell}.VarIndex_coord_y)%case of unstructured data
     129                                    X=Field.(Field.ListVarName{CellInfo{icell}.VarIndex_coord_x});
     130                                    Y=Field.(Field.ListVarName{CellInfo{icell}.VarIndex_coord_y});
     131                                    flag_vec=(X<(xy(1,1)+Field.CoordMesh/4) & X>(xy(1,1)-Field.CoordMesh/4)) & ...%flagx=1 for the vectors with x position selected by the mouse
     132                                        (Y<(xy(1,2)+Field.CoordMesh/4) & Y>(xy(1,2)-Field.CoordMesh/4));%f
     133                                    ivec=find(flag_vec,1);% search the (first) selected vector index ivec
     134                                end
    134135                            end
    135136                        end
    136                     end
    137137                    end
    138138                end
Note: See TracChangeset for help on using the changeset viewer.