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

Setting/updating canvas width to 100% #86

Open
pimmey opened this issue Aug 14, 2016 · 1 comment
Open

Setting/updating canvas width to 100% #86

pimmey opened this issue Aug 14, 2016 · 1 comment

Comments

@pimmey
Copy link

pimmey commented Aug 14, 2016

Right, setting it is quite straightforward, just doing

fullscreen: false,
width: window.innerWidth

Now, to update it, I did something like this:

gl.resize = function () {
    this.width = window.innerWidth; // Updating the width
    this.viewport(0, 0, this.width, this.height);
    return this.updateUniforms();
};

However it is quite choppy and doesn't update the width precisely. Only if I resize the window really slowly, it is more or less fine, but when doing it even a bit faster, it just doesn't fill the whole width.

Is there maybe another way to accomplish this?

@Sporradik
Copy link

Sporradik commented Sep 30, 2019

I am experiencing the same issue

EDIT: @pimmey perhaps 3 years later is too late, but setting this.canvas.width and this.canvas.height ended up working for me.

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

2 participants