Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualizer randomly pauses #48

Open
Tarnasa opened this issue May 28, 2019 · 0 comments
Open

Visualizer randomly pauses #48

Tarnasa opened this issue May 28, 2019 · 0 comments

Comments

@Tarnasa
Copy link

Tarnasa commented May 28, 2019

The visualizer will randomly pause, and must be manually unpaused by clicking the pause/unpause button.

From src/viseur/time-manager.ts

        this.viseur.gui.events.playbackSlide.on((value) => {
            const index = Math.floor(value);
            const dt = value - index;
            const current = this.getCurrentTime();
            if (Math.abs(value - current.index - current.dt) > 0.10) {
                // the change in time was too great, they probably clicked far away
                this.pause(index, dt);
            }
        });

While the intent of this code is to pause the visualizer when the user clicks on the slider, it seems to also trigger randomly because the slider is not always in sync with the timer.

I'm not sure of the reason for the desynchronization, the pauses are always at different deltas even for the same gamelog, so I'm inclined to believe there is some sort of race condition.

A proper fix would distinguish human-generated clicks on the slider from programmatic changes to the slider's value, however the necessary information to distinguish (event.isTrusted) does not seem to be piped through.

An easier fix would be to replace
this.pause(index, dt);
with
this.setTime(index, dt);
So that changes to the slider never cause a pause. If the user wants to jump to a specific point while paused, they can simply pause, and then click.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant