Changeset 252 for trunk/src/mouse_up.m
- Timestamp:
- May 15, 2011, 11:17:08 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_up.m
r221 r252 250 250 if isequal(get(currentfig,'SelectionType'),'normal');%if left button has been pressed, zoom in by a factor of 2 251 251 xlim(1)=0.5*xy(1,1)+0.5*xlim(1); 252 xlim(2)=0.5*xy(1,1)+0.5*xlim(2); 252 xlim(2)=0.5*xy(1,1)+0.5*xlim(2);%double the field whith the middle at the selected points 253 253 set(currentaxes,'XLim',xlim) 254 254 ylim(2)=0.5*xy(1,2)+0.5*ylim(2); … … 257 257 % if right mouse button has been pressed, zoom out by a factor of 2 258 258 else 259 xlim(1)=2*xlim(1)-xy(1,1); 259 xlim(1)=2*xlim(1)-xy(1,1);% reverse of the zoom on action 260 260 xlim(2)=2*xlim(2)-xy(1,1); 261 261 ylim(1)=2*ylim(1)-xy(1,2); 262 262 ylim(2)=2*ylim(2)-xy(1,2); 263 263 if isfield(AxeData,'RangeX')&& isfield(AxeData,'RangeY') 264 'TESTup'265 AxeData266 264 xlim(1)=max(AxeData.RangeX(1),xlim(1)); 267 265 xlim(2)=min(AxeData.RangeX(2),xlim(2)); 268 266 ylim(1)=max(AxeData.RangeY(1),ylim(1)); 269 267 ylim(2)=min(AxeData.RangeY(2),ylim(2)); 268 if ylim(1)>=ylim(2)|| xlim(1)>=xlim(2) 269 xlim=AxeData.RangeX; 270 ylim=AxeData.RangeY; 271 end 270 272 % desactivate the zoom if the full field is visible within the axes 271 273 if isequal(xlim,AxeData.RangeX) && isequal(ylim,AxeData.RangeY) … … 276 278 end 277 279 end 278 xlim279 ylim280 280 set(currentaxes,'XLim',xlim) 281 281 set(currentaxes,'YLim',ylim)
Note: See TracChangeset
for help on using the changeset viewer.