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 119119 % Draw aperture and we rotate to match the required condition
120120 Screen(' DrawTexture' , cfg .screen .win , cfg .aperture .texture , ...
121121 cfg .screen .winRect , ...
122- cfg .screen .winRect , ...
122+ CenterRect(...
123+ cfg .screen .winRect * cfg .magnify .scalingFactor , ...
124+ cfg .screen .winRect ), ...
123125 thisEvent .condition - 90 );
124126 else
125127
163165 end
164166
165167 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
166175
167176 % 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 = ...
170180 [0 : cfg .aperture .barWidthPix : cfg .stimRect(3 ) - cfg .aperture .barWidthPix ] + ...
171181 (cfg .screen .winRect(3 ) / 2 - cfg .stimRect(3 ) / 2 ) + ...
172182 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 ;
173191
174192 % Width of bar in degrees of VA (needed for saving)
175193 cfg.aperture.width = cfg .aperture .barWidthPix / cfg .screen .ppd ;
You can’t perform that action at this time.
0 commit comments