CadQuery / CadQuery/sphinxcadquery
Could we skip off-screen scenes rendering?
- Dominant language
- JavaScript
- Stars
- 16
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
We used to have this check in the loop:
```js
scenes.forEach( function ( scene ) {
var rect = scene.userData.view.getBoundingClientRect();
// check if it's offscreen. If so skip it
if ( rect.bottom < 0 || rect.top > renderer.domElement.clientHeight ||
rect.right < 0 || rect.left > renderer.domElement.clientWidth ) {
return; // it's off screen
}
// set the viewport
var width = rect.right - rect.left;
var height = rect.bottom - rect.top;
var left = rect.left;
var bottom = renderer.domElement.clientHeight - rect.bottom;
renderer.setViewport( left, bottom, width, height );
renderer.setScissor( left, bottom, width, height );
var camera = scene.userData.camera
camera.aspect = width / height;
camera.updateProjectionMatrix();
renderer.render( scene, scene.userData.camera );
} );
```
However, it resulted in scenes "sticking" when scrolling up/down.
How to reproduce: go to one scene and scroll *fast* up or down. The scene, or part of it, may get stuck to the view, as long as another scene does not appear with the scroll (i.e.: try to scroll away from any scenes).
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.