Skip to content

Commit 6061353

Browse files
committed
make it possible to scale bar aperture
1 parent d0d30b4 commit 6061353

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/aperture/apertureTexture.m

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,18 @@
120120
case 'draw'
121121

122122
if strcmp(cfg.aperture.type, 'bar')
123-
123+
124+
scalingFactor = 1;
125+
if isfield(cfg, 'scalingFactor') && ~isempty(cfg.scalingFactor)
126+
scalingFactor = cfg.scalingFactor;
127+
end
128+
124129
% Draw aperture and we rotate to match the required condition
125130
Screen('DrawTexture', cfg.screen.win, cfg.aperture.texture, ...
126131
cfg.screen.winRect, ...
127-
cfg.screen.winRect, ...
132+
CenterRect(cfg.screen.winRect * scalingFactor, cfg.screen.winRect), ...
128133
thisEvent.condition - 90);
134+
129135
else
130136

131137
Screen('DrawTexture', cfg.screen.win, cfg.aperture.texture);
@@ -187,4 +193,4 @@
187193

188194
end
189195

190-
end
196+
end

0 commit comments

Comments
 (0)