Skip to content

Commit

Permalink
CSS2DRenderer: Just traverse visible object (#28330)
Browse files Browse the repository at this point in the history
* add cache empty check and set a default value

* Update CSS2DRenderer.js

* Update CSS2DRenderer.js

Fix code style.

---------

Co-authored-by: Michael Herzog <michael.herzog@human-interactive.org>
  • Loading branch information
lafflan and Mugen87 committed May 10, 2024
1 parent a2f0682 commit a13bb05
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/jsm/renderers/CSS2DRenderer.js
Expand Up @@ -124,6 +124,7 @@ class CSS2DRenderer {
hideObject( object.children[ i ] );

}

}

function renderObject( object, scene, camera ) {
Expand Down Expand Up @@ -186,7 +187,7 @@ class CSS2DRenderer {

const result = [];

scene.traverse( function ( object ) {
scene.traverseVisible( function ( object ) {

if ( object.isCSS2DObject ) result.push( object );

Expand Down

0 comments on commit a13bb05

Please sign in to comment.