Skip to content

Commit

Permalink
BF: Fix polygon vertices each frame/repeat setting
Browse files Browse the repository at this point in the history
  • Loading branch information
TEParsons committed Nov 30, 2022
1 parent 1e0b107 commit e493ee2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions psychopy/experiment/components/polygon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __init__(self, exp, parentName, name='polygon', interpolate='linear',
self.params['nVertices'] = Param(
nVertices, valType='int', inputType="single", categ='Basic',
updates='constant',
allowedUpdates=['constant'],
allowedUpdates=['constant', 'set every repeat', 'set every frame'],
hint=msg,
label=_localized['nVertices'])

Expand Down Expand Up @@ -156,11 +156,11 @@ def writeInitCode(self, buff):
inits['size'].val = '[1.0, 1.0]'

if self.params['shape'] == 'regular polygon...':
vertices = self.params['nVertices']
vertices = inits['nVertices']
elif self.params['shape'] == 'custom polygon...':
vertices = self.params['vertices']
vertices = inits['vertices']
else:
vertices = self.params['shape']
vertices = inits['shape']
if vertices in ['line', '2']:
code = ("%s = visual.Line(\n" % inits['name'] +
" win=win, name='%s',%s\n" % (inits['name'], unitsStr) +
Expand Down

0 comments on commit e493ee2

Please sign in to comment.