Skip to content

Commit

Permalink
Save the startX/Y property for restoring
Browse files Browse the repository at this point in the history
  • Loading branch information
kurokida committed Sep 15, 2020
1 parent b3fb372 commit b7bf24f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ demos/test0518.html
demos/test0518b.html
jspsych-psychophysics03.js
calc_velocityを変更しようとしてやめたやつ.js
jspsych-psychophysics20200912.js
12 changes: 12 additions & 0 deletions jspsych-psychophysics.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,18 @@ jsPsych.plugins["psychophysics"] = (function() {
}

function common_set(stim){
// restore original values
if (typeof stim.original_startX === 'undefined') {
stim.original_startX = stim.startX;
} else {
stim.startX = stim.original_startX;
};
if (typeof stim.original_startY === 'undefined') {
stim.original_startY = stim.startY;
} else {
stim.startY = stim.original_startY;
};

if (stim.startX === 'center') {
if (stim.origin_center) {
stim.startX = 0;
Expand Down

0 comments on commit b7bf24f

Please sign in to comment.