Ignore:
Timestamp:
Dec 9, 2010, 11:31:04 PM (14 years ago)
Author:
sommeria
Message:

civ.m: bug on field numbers repaired
other: various cleaning and bug repair for the creation of a new object

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mouse_motion.m

    r152 r153  
    148148%                                     nxy(1)=numel(y);
    149149%                                     nxy(2)=numel(x);
    150                                     MaxAY=max(y(1),y(end));
    151                                     MinAY=min(y(1),y(end));
    152                                     if (xy(1,1)>x(1))&(xy(1,1)<x(end))&(xy(1,2)<MaxAY)&(xy(1,2)>MinAY)
    153                                         indx0=1+round((nxy(2)-1)*(xy(1,1)-x(1))/(x(end)-x(1)));% index x of pixel
    154                                         indy0=1+round((nxy(1)-1)*(xy(1,2)-y(1))/(y(end)-y(1)));% index y of pixel
     150                                    MaxAY=max(y(1),y(end)); %#ok<COLND>
     151                                    MinAY=min(y(1),y(end)); %#ok<COLND>
     152                                    if (xy(1,1)>x(1))&(xy(1,1)<x(end))&(xy(1,2)<MaxAY)&(xy(1,2)>MinAY) %#ok<COLND>
     153                                        indx0=1+round((nxy(2)-1)*(xy(1,1)-x(1))/(x(end)-x(1)));%#ok<COLND> % index x of pixel
     154                                        indy0=1+round((nxy(1)-1)*(xy(1,2)-y(1))/(y(end)-y(1)));%#ok<COLND> % index y of pixel
    155155                                        if indx0>=1 & indx0<=nxy(2) & indy0>=1 & indy0<=nxy(1)
    156156                                            text_displ_2=['i='  num2str(indx0) ',j=' num2str(indy0) ','];
Note: See TracChangeset for help on using the changeset viewer.