Changeset 483 for trunk/src/mouse_up.m
- Timestamp:
- Jun 26, 2012, 11:50:19 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_up.m
r444 r483 244 244 xlim=get(currentaxes,'XLim'); 245 245 ylim=get(currentaxes,'YLim'); 246 % if left mouse button has been pressed, zoom in by a factor of 2246 % if left mouse button has been pressed, zoom in by a factor of 2 247 247 if isequal(get(currentfig,'SelectionType'),'normal');%if left button has been pressed, zoom in by a factor of 2 248 xlim(1)=0.5*xy(1,1)+0.5*xlim(1); 249 xlim(2)=0.5*xy(1,1)+0.5*xlim(2);%double the field whith the middle at the selected points 250 set(currentaxes,'XLim',xlim) 251 ylim(2)=0.5*xy(1,2)+0.5*ylim(2); 252 ylim(1)=0.5*xy(1,2)+0.5*ylim(1); 253 set(currentaxes,'YLim',ylim) 254 % if right mouse button has been pressed, zoom out by a factor of 2 248 PlotBoxAspectRatio=get(currentaxes,'PlotBoxAspectRatio'); 249 yoverx=PlotBoxAspectRatio(2)/PlotBoxAspectRatio(1); 250 if yoverx <2 251 xlim(1)=0.5*xy(1,1)+0.5*xlim(1); 252 xlim(2)=0.5*xy(1,1)+0.5*xlim(2);%double the field whith the middle at the selected points 253 set(currentaxes,'XLim',xlim) 254 end 255 if yoverx >0.5 256 ylim(2)=0.5*xy(1,2)+0.5*ylim(2); 257 ylim(1)=0.5*xy(1,2)+0.5*ylim(1); 258 set(currentaxes,'YLim',ylim) 259 end 260 261 % if right mouse button has been pressed, zoom out by a factor of 2 255 262 else 256 263 xlim(1)=2*xlim(1)-xy(1,1);% reverse of the zoom on action … … 267 274 ylim=AxeData.RangeY; 268 275 end 269 % desactivate the zoom if the full field is visible within the axes276 % desactivate the zoom if the full field is visible within the axes 270 277 if isequal(xlim,AxeData.RangeX) && isequal(ylim,AxeData.RangeY) 271 278 set(hhuvmat.CheckZoom,'Value',0) … … 323 330 %% finalising ruler 324 331 if test_ruler 325 set(hhuvmat.MenuRuler,'checked','off')%desable the ruler option in uvmat 326 xy=get(currentaxes,'CurrentPoint');% get the current mouse coordinates 327 RulerCoord=[AxeData.RulerCoord ;xy(1,1:2)];% append the recorded ruler origin to the current mouse coordinates 332 set(hhuvmat.MenuRuler,'checked','off')%desable the ruler option in uvmat 333 xy=get(currentaxes,'CurrentPoint');% get the current mouse coordinates 334 RulerCoord=[AxeData.RulerCoord ;xy(1,1:2)];% append the recorded ruler origin to the current mouse coordinates 328 335 RulerCoord=diff(RulerCoord,1);% coordiante difference between segment end and beginning 329 336 RulerCoord=RulerCoord(1)+i*RulerCoord(2);
Note: See TracChangeset
for help on using the changeset viewer.