Ignore:
Timestamp:
Feb 27, 2013, 6:39:32 PM (11 years ago)
Author:
sommeria
Message:

various bugs corrected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mouse_motion.m

    r542 r575  
    110110                    for icell=1:numel(CellInfo)%look for all physical fields
    111111                        if NbDimArray(icell)>=2 % select 2D field
    112                             if  isfield(Field,'Mesh') && ~isempty(Field.Mesh)&& strcmp(CellInfo{icell}.CoordType,'scattered')%case of unstructured data
     112                            if  isfield(Field,'CoordMesh') && ~isempty(Field.CoordMesh)&& strcmp(CellInfo{icell}.CoordType,'scattered')%case of unstructured data
    113113                                X=Field.(Field.ListVarName{CellInfo{icell}.CoordIndex(end)});
    114114                                Y=Field.(Field.ListVarName{CellInfo{icell}.CoordIndex(end-1)});
    115                                 flag_vec=(X<(xy(1,1)+Field.Mesh/3) & X>(xy(1,1)-Field.Mesh/3)) & ...%flagx=1 for the vectors with x position selected by the mouse
    116                                     (Y<(xy(1,2)+Field.Mesh/3) & Y>(xy(1,2)-Field.Mesh/3));%f
     115                                flag_vec=(X<(xy(1,1)+Field.CoordMesh/3) & X>(xy(1,1)-Field.CoordMesh/3)) & ...%flagx=1 for the vectors with x position selected by the mouse
     116                                    (Y<(xy(1,2)+Field.CoordMesh/3) & Y>(xy(1,2)-Field.CoordMesh/3));%f
    117117                                ivec=find(flag_vec,1);% search the (first) selected vector index ivec
    118118                                hhh=findobj(CurrentAxes,'Tag','vector_marker');
     
    125125                                            set(CurrentFig,'CurrentAxes',CurrentAxes)
    126126                                            rectangle('Curvature',[1 1],...
    127                                                 'Position',[X(ivec)-Field.Mesh/2 Y(ivec)-Field.Mesh/2 Field.Mesh Field.Mesh],'EdgeColor','m',...
     127                                                'Position',[X(ivec)-Field.CoordMesh/2 Y(ivec)-Field.CoordMesh/2 Field.CoordMesh Field.CoordMesh],'EdgeColor','m',...
    128128                                                'LineStyle','-','Tag','vector_marker');
    129129                                        else
    130130                                            set(hhh,'Visible','on')
    131                                             set(hhh,'Position',[X(ivec)-Field.Mesh/2 Y(ivec)-Field.Mesh/2 Field.Mesh Field.Mesh])
     131                                            set(hhh,'Position',[X(ivec)-Field.CoordMesh/2 Y(ivec)-Field.CoordMesh/2 Field.CoordMesh Field.CoordMesh])
    132132                                        end
    133133                                    end
Note: See TracChangeset for help on using the changeset viewer.