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

Duplicate DOM elements when upload multiple pictures in order #8

Open
hijiangtao opened this issue Apr 2, 2019 · 1 comment
Open

Comments

@hijiangtao
Copy link

I found it will not remove the older DOM element when I upload a new picture for generating a new emoji-mosaic picture.

Maybe you should change this line a little bit, https://github.com/ericandrewlewis/emoji-mosaic/blob/master/index.html#L112

Just don't generate a canvas element each time, but keep a reference of it when it first generated, so that you can utilize it and just clear it each time you need to re-paint a new picture, codes like this way:

const gl = canvasEl.getContext('webgl');
gl.clearColor(1.0, 1.0, 1.0, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT);

And thanks for the idea! It's really interesting by the way! :-)

@AmbitiousK
Copy link

Keep going, man!

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