-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMipButtonDown.m
36 lines (30 loc) · 994 Bytes
/
MipButtonDown.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function MipButtonDown(src,event)
global FIGURE_HANDLE AXES_HANDLES REC_HANDLES OUTDATED_ANNOTATION
selectedAxes = find(event.Source.CurrentAxes == AXES_HANDLES);
if (selectedAxes>3)
return
end
mousePos = get(AXES_HANDLES(selectedAxes),'currentPoint');
pointDown_xy = round(mousePos(1,1:2));
if (any(pointDown_xy<1))
return
end
xL = get(AXES_HANDLES(selectedAxes),'xlim');
if (xL(2)<pointDown_xy(1))
return
end
yL = get(AXES_HANDLES(selectedAxes),'ylim');
if (yL(2)<pointDown_xy(2))
return
end
ud = get(FIGURE_HANDLE,'UserData');
if (~ud.IsDown)
OUTDATED_ANNOTATION.Visible = true;
ud.IsDown = true;
ud.PointDown_xy = pointDown_xy;
set(FIGURE_HANDLE,'UserData',ud);
if (~ud.ShiftKey && ~ud.ControlKey && ~ud.AltKey)
UpdateRecCenter(pointDown_xy,selectedAxes,REC_HANDLES,':');
end
end
end