Browse Source

Unpause toggle fix: does not reset when toggled off

main
Cailean 4 weeks ago
parent
commit
f7e91cc4c3
  1. 15
      src/ofTeleprompter.cpp

15
src/ofTeleprompter.cpp

@ -305,16 +305,21 @@ void ofTeleprompter::toggleContempScript(bool & val) {
currentLine = currentLineScript;
}
} else {
// Always start from line 0 if not pausing
// Set both trackers to the current line of the script being left
if (activeScript == &script) {
currentLineScript = currentLine;
currentLineContemporary = currentLine;
} else {
currentLineContemporary = currentLine;
currentLineScript = currentLine;
}
if (val) {
activeScript = &scriptContemporary;
} else {
activeScript = &script;
}
// Set both script line trackers to the same value
currentLine = 0;
currentLineScript = currentLine;
currentLineContemporary = currentLine;
currentLine = currentLineScript; // or currentLineContemporary, both are now the same
}
ofLog() << "Script Size:" + (*activeScript).size();

Loading…
Cancel
Save