I am working on a ProcessingJS visualization, and I have been noticing that the performance degrades noticeably when a user selects the canvas element.
Unfortunately, I only have it working locally, so I can't send a link to the actual page, but here is a 10 second screen cast of the behavior.
When the page loads, and the canvas is not selected, the sketch seems to render at a reasonable pace. If I click the black background of the canvas element, however, the sketch starts drawing noticeably slower. Clicking somewhere else, like outside the browser, or in the url bar to take the focus off of the canvas element improves the performance back to where it was on page load.
so 2 questions:
1) Why is this happening?
2) Is there a way to prevent this? I imagine by preventing the user from focusing the canvas element at all, but open to any suggestions.
I have tried these responses, question1, question2 in regards to disabling user selection of the canvas, but didn't have any luck.
Thank you!