File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change 119
119
% Draw aperture and we rotate to match the required condition
120
120
Screen(' DrawTexture' , cfg .screen .win , cfg .aperture .texture , ...
121
121
cfg .screen .winRect , ...
122
- cfg .screen .winRect , ...
122
+ CenterRect(...
123
+ cfg .screen .winRect * cfg .magnify .scalingFactor , ...
124
+ cfg .screen .winRect ), ...
123
125
thisEvent .condition - 90 );
124
126
else
125
127
163
165
end
164
166
165
167
case ' bar'
168
+
169
+ extraPositons = 0 ;
170
+ if cfg .magnify .do
171
+ % we add some extra bar positions that we remove afterwards to
172
+ % prevent having nothing on screen for a long time
173
+ extraPositons = 12 ;
174
+ end
166
175
167
176
% Set parameters drifting bars
168
- cfg.aperture.barWidthPix = cfg .stimRect(3 ) / cfg .volsPerCycle ;
169
- cfg.aperture.barPosPix = ...
177
+ cfg.aperture.barWidthPix = cfg .stimRect(3 ) / (cfg .volsPerCycle + extraPositons );
178
+
179
+ barPosPix = ...
170
180
[0 : cfg .aperture .barWidthPix : cfg .stimRect(3 ) - cfg .aperture .barWidthPix ] + ...
171
181
(cfg .screen .winRect(3 ) / 2 - cfg .stimRect(3 ) / 2 ) + ...
172
182
cfg .aperture .barWidthPix / 2 ; % #ok<NBRAK>
183
+
184
+ % Those positions are removed because they are actually outside of
185
+ % the screen when magnification (fit to windows width) is on
186
+ if cfg .magnify .do
187
+ barPosPix([1 : 6 , end - 5 : end ]) = [];
188
+ end
189
+
190
+ cfg.aperture.barPosPix = barPosPix ;
173
191
174
192
% Width of bar in degrees of VA (needed for saving)
175
193
cfg.aperture.width = cfg .aperture .barWidthPix / cfg .screen .ppd ;
You can’t perform that action at this time.
0 commit comments