patriciogonzalezvivo / glslCanvas

Simple tool to load GLSL shaders on HTML Canvas using WebGL
http://patriciogonzalezvivo.github.io/glslCanvas/
MIT License
1.97k stars 183 forks source link

Improve check for whether canvas is visible #47

Closed whydoubt closed 2 years ago

whydoubt commented 5 years ago

As seen with https://stackoverflow.com/questions/57676500 scaling the canvas causes problems for glslCanvas. This is because checking for whether the canvas is visible mixes values from the bounding client rect (which is affected by scaling), with the canvas element (which is not).

Use the bounding client rect to determine the visibility of the canvas.

patriciogonzalezvivo commented 5 years ago

thanks! do you mind mergin master and rebuilding? I apologize for the delay