File tree Expand file tree Collapse file tree 1 file changed +18
-10
lines changed
psychopy/experiment/components/settings Expand file tree Collapse file tree 1 file changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -723,17 +723,25 @@ def writeWindowCode(self, buff):
723
723
buff .writeIndentedLines (code )
724
724
725
725
def writeWindowCodeJS (self , buff ):
726
+ """Setup the JS window code.
727
+ """
728
+ # Replace instances of 'use prefs'
729
+ units = self .params ['Units' ].val
730
+ if units == 'use prefs' :
731
+ units = 'height'
732
+
726
733
code = ("// init psychoJS:\n "
727
- "var psychoJS = new PsychoJS({{\n "
728
- " debug: true\n "
729
- "}});\n \n "
730
- "// open window:\n "
731
- "psychoJS.openWindow({{\n "
732
- " fullscr: {fullScr},\n "
733
- " color: new util.Color({params[color]}),\n "
734
- " units: {params[Units]}\n "
735
- "}});\n " ).format (fullScr = str (self .params ['Full-screen window' ]).lower (),
736
- params = self .params )
734
+ "var psychoJS = new PsychoJS({{\n "
735
+ " debug: true\n "
736
+ "}});\n \n "
737
+ "// open window:\n "
738
+ "psychoJS.openWindow({{\n "
739
+ " fullscr: {fullScr},\n "
740
+ " color: new util.Color({params[color]}),\n "
741
+ " units: '{units}'\n "
742
+ "}});\n " ).format (fullScr = str (self .params ['Full-screen window' ]).lower (),
743
+ params = self .params ,
744
+ units = units )
737
745
buff .writeIndentedLines (code )
738
746
739
747
def writeEndCode (self , buff ):
You can’t perform that action at this time.
0 commit comments