psychopy.org | Reference | Downloads | Github

Circle shape was interpreted as shape with four edges(diamond) when rewritten in JS language in pavlovia

Hi,
I used builder + code compenent to build my experiment. I set a lot of circle stimulus through polygon component. However, when I run the online version, all the circles became diamonds. And after carefully checking the .js file, I found in .js file, the circle polygon was initiated as shape with 4 edges. It was differently defined when compared with star shape, which can be correctly showed on screen.

Snipaste_2021-10-11_17-18-57

code example: piece_2 was defined as cross, and piece_3 was defined as a circle.
In .js file:
piece_2 = new visual.ShapeStim ({
win: psychoJS.window, name: ‘piece_2’,
vertices: ‘cross’, size:circlesize,
ori: 0.0, pos: [(piecexpos + piecexlag), pieceypos],
lineWidth: 1.0, lineColor: new util.Color(‘gray’),
fillColor: new util.Color(‘black’),
opacity: undefined, depth: -10, interpolate: true,
});

piece_3 = new visual.Polygon ({
win: psychoJS.window, name: ‘piece_3’,
edges: 4, size:circlesize,
ori: 0.0, pos: [(piecexpos + (2 * piecexlag)), pieceypos],
lineWidth: 1.0, lineColor: new util.Color(‘gray’),
fillColor: new util.Color(‘black’),
opacity: undefined, depth: -11, interpolate: true,
});

In .py file
piece_2 = visual.ShapeStim(
win=win, name=‘piece_2’, vertices=‘cross’,
size=circlesize,
ori=0.0, pos=(piecexpos+piecexlag, pieceypos),
lineWidth=1.0, colorSpace=‘rgb’, lineColor=‘gray’, fillColor=‘black’,
opacity=None, depth=-10.0, interpolate=True)
piece_3 = visual.ShapeStim(
win=win, name=‘piece_3’,
size=circlesize, vertices=‘circle’,
ori=0.0, pos=(piecexpos+2*piecexlag, pieceypos),
lineWidth=1.0, colorSpace=‘rgb’, lineColor=‘gray’, fillColor=‘black’,
opacity=None, depth=-11.0, interpolate=True)

Apparently, there is something wrong with .js file. So, I was wondering it is a bug about PsychoPy itself or I changed any possible setting to make this mistake happen?

PsychoPy version: v2021.2.3

Thanks for any feedback
Tang


Update:

I tried manually to edit the .js file, replacing " edges: 4 " with " vertice:‘circle’ ". But it failed since the pavlovia returned a mistake.图片