Skip to content

Commit

Permalink
A few more mobius improvements for phetsims/density#32
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Aug 4, 2020
1 parent 3932b2f commit d0ab7e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions js/ThreeIsometricNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ class ThreeIsometricNode extends Node {
this.backgroundEventTarget = new Rectangle( {} );
this.addChild( this.backgroundEventTarget );

// @private add the Canvas in with a DOM node that prevents Scenery from applying transformations on it
// @private {DOM} - add the Canvas in with a DOM node that prevents Scenery from applying transformations on it
this.domNode = new DOM( this.stage.threeRenderer.domElement, {
preventTransform: true, // Scenery override for transformation
invalidateDOM: function() { // don't do bounds detection, it's too expensive. We're not pickable anyways
this.invalidateSelf( new Bounds2( 0, 0, 0, 0 ) );
},
pickable: false
} );

// don't do bounds detection, it's too expensive. We're not pickable anyways
this.domNode.invalidateDOM = () => this.domNode.invalidateSelf( new Bounds2( 0, 0, 0, 0 ) );
this.domNode.invalidateDOM();

/**
Expand Down Expand Up @@ -140,7 +140,7 @@ class ThreeIsometricNode extends Node {
* Renders the simulation to a specific rendering target
* @public
*
* @param {THREE.WebGLRenderTarget|undefined} - undefined for the default target
* @param {THREE.WebGLRenderTarget|undefined} target - undefined for the default target
*/
render( target ) {
this.stage.render( target );
Expand Down
4 changes: 3 additions & 1 deletion js/ThreeNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ class ThreeNode extends Node {
preventTransform: true, // Scenery override for transformation
pickable: false
} );
this.domNode.calculateDOMBounds = () => new Bounds2( 0, 0, 0, 0 );

// don't do bounds detection, it's too expensive. We're not pickable anyways
this.domNode.invalidateDOM = () => this.domNode.invalidateSelf( new Bounds2( 0, 0, 0, 0 ) );
this.domNode.invalidateDOM();

const forceAcceleration = false;
Expand Down

0 comments on commit d0ab7e1

Please sign in to comment.