psychopy / psychojs

PsychoJS is the online counterpart of the PsychoPy Python library
MIT License
165 stars 68 forks source link

Form layout gets mangled in PsychoPy 2023.2.2 to PsychoJS export but not in 2022.1.4 #584

Open fuimsr opened 1 year ago

fuimsr commented 1 year ago

Hey friendly community,

I’ve tried implementing an online experiment with the PsychoPy 2023.2.2 builder. It contains a form, which unfortunately is mangled as soon as I try it in the local browser: PsychoPy: PsychoPy PsychoJS: PsychoJS

Interestingly enough, this issue is not there in older versions of PsychoPy, here's the PsychoJS version for 2022.1.4: Capture2

Here’s the minimal experiment to reproduce the issue: form_issue.zip

I would be in to help debugging/fixing this if there is a possibility to do this.

fuimsr commented 1 year ago

Found the culprit, it is this commit:

https://github.com/psychopy/psychojs/commit/a1effe6969f8fa2608f4bfec208085e25969f410#diff-3cb0e9acf2c1d3de7596f8be62a7bff3be8f42f505e2e65f5fe8b683100097a6

Changing the lines in psychojs-2023.2.2.js

from: this._win._stimsContainer.position.x + this._leftEdge_px + 2, this._win._stimsContainer.position.y + this._bottomEdge_px + 2,

to: this._win._rootContainer.position.x + this._leftEdge_px + 2, this._win._rootContainer.position.y + this._bottomEdge_px + 2,

brings back the full layout:

grafik

Edit: updated screenshot