|
1 | 1 | function drawFixation(cfg) |
2 | 2 | % Define the parameters of the fixation cross in `cfg` and `expParameters` |
3 | | - |
4 | | - if strcmp(cfg.fixation.type, 'cross') |
5 | | - |
6 | | - smooth = 1; |
7 | | - |
8 | | - Screen('DrawLines', ... |
9 | | - cfg.screen.win, ... |
10 | | - cfg.fixation.allCoords, ... |
11 | | - cfg.fixation.lineWidthPix, ... |
12 | | - cfg.fixation.color, ... |
13 | | - [cfg.screen.center(1) cfg.screen.center(2)], smooth); |
| 3 | + |
| 4 | + switch cfg.fixation.type |
| 5 | + case 'cross' |
| 6 | + |
| 7 | + smooth = 1; |
| 8 | + |
| 9 | + Screen('DrawLines', ... |
| 10 | + cfg.screen.win, ... |
| 11 | + cfg.fixation.allCoords, ... |
| 12 | + cfg.fixation.lineWidthPix, ... |
| 13 | + cfg.fixation.color, ... |
| 14 | + [cfg.screen.center(1) cfg.screen.center(2)], smooth); |
| 15 | + |
| 16 | + case 'dot' |
| 17 | + |
| 18 | + % Draw gap around fixation of 20% the size |
| 19 | + Screen('FillOval', ... |
| 20 | + cfg.screen.win, ... |
| 21 | + cfg.color.background, ... |
| 22 | + CenterRect( ... |
| 23 | + [0 0 repmat(1.2 * cfg.fixation.widthPix, 1, 2)], ... |
| 24 | + cfg.screen.winRect)); |
| 25 | + |
| 26 | + % Draw fixation |
| 27 | + Screen('FillOval', ... |
| 28 | + cfg.screen.win, ... |
| 29 | + cfg.color.foreground, ... |
| 30 | + CenterRect( ... |
| 31 | + [0 0 repmat(cfg.fixation.widthPix, 1, 2)], ... |
| 32 | + cfg.screen.winRect)); |
14 | 33 | end |
15 | | - |
| 34 | + |
16 | 35 | end |
0 commit comments