-
Notifications
You must be signed in to change notification settings - Fork 0
/
clickAction.m
29 lines (26 loc) · 993 Bytes
/
clickAction.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
function clickAction(src, callbackdata)
type = get(src, 'SelectionType');
handles = get(src, 'UserData');
switch type
case 'alt'
% disp('Ouch! I was Control-clicked');
cp = get(gca, 'CurrentPoint');
tag = get(gca, 'Tag');
if isequal(tag, 'blinks')
m = cp(1,1)/255;
r = cp(1,2);
d = (handles.results.blinkRho - r).^2 +...
(handles.results.blinkMean/255 - m).^2;
[~, iFrame] = min(d);
else
x = cp(1);
nAvailableFrames = handles.vr.NumberOfFrames;
iFrame = min(max(1, round(x)), nAvailableFrames);
end
set(handles.FrameSlider, 'Value', iFrame);
etGUI('FrameSlider_Callback', handles.FrameSlider, [], guidata(handles.figure1));
etGUI('PlotPush_Callback', handles.PlotPush, [], guidata(handles.figure1));
% handles.figure1 is a handle of the main etGUI figure
otherwise
% disp('I was clicked')
end