Brush Component Online Behaviour Differs from Offline

https://run.pavlovia.org/dagmarfraser/basic-brush/

Hey all, I have been trying to use the Brush Component Online but I get weird behaviour. The expected lines is drawn but an additional extraneous line is also drawn from the origin of the movement, to the current cursor location. This also occurs in this untouched example code here in the most recent Pavlovia; Files · master · Rebecca Hirst / basic-brush · GitLab

If I draw a ‘z’ shape, starting top left, an additional line is drawn from top left origin to the bottom right. As shown here, highlighted in yellow.

Dropbox - Capture.PNG - Simplify your life

Brush component is not listed as not working / working on the status page; Status of online options — PsychoPy v2020.2

So I researched the issue further;

This is the javascript attempting to close the shape. However the auto generated experiment js has the line closeShape: false, which apparently it is not respecting.

Ultimately my issue is a duplicate of the issue from here in '19 - Drawing using the mouse as a brush - #6 by smweis

Here Jon’s answer is marked as a solution! My question is how do i implement this solution? ShapeStim.js is inside the local PsychoPy package, so how do i change @param {boolean} [options.closeShape= false] from the irksome true?

Hey Dagmar,

I reproduced your issue, but I haven’t found a solution yet, so I’ll ask around a bit. Update (hopefully :)) before the week is done!

Best, Thomas

2 Likes

Hey again,

So, we’ve done two things:

  1. Here is a demo with a workaround: Brush tool closes automatically in psychojs/online, despite closeShape : false - #10 by jameslc
  2. Found the issue in the library and proposed a workaround. Could take a while before it’s integrated in the library though: Keeping a ShapeStim open (via PIXI.Polygon.closeStroke == false) · Issue #273 · psychopy/psychojs · GitHub