Skip to content

Commit

Permalink
Disable clipping on mobile safari, see #322
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Jan 25, 2019
1 parent 9e679a3 commit 62ff503
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 69 deletions.
62 changes: 0 additions & 62 deletions js/common/view/SceneryWebGLClippingRegion.js

This file was deleted.

2 changes: 1 addition & 1 deletion js/common/view/SoundParticleImageLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* When selected, shows discrete and moving particles for the sound view.
* TODO: docs if this works
* Note: Clipping is not enabled on mobileSafari, see https://github.com/phetsims/wave-interference/issues/322
*
* @author Sam Reid (PhET Interactive Simulations)
*/
Expand Down
7 changes: 1 addition & 6 deletions js/waves/view/WavesScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ define( require => {
const Rectangle = require( 'SCENERY/nodes/Rectangle' );
const ResetAllButton = require( 'SCENERY_PHET/buttons/ResetAllButton' );
const RichText = require( 'SCENERY/nodes/RichText' );
const SceneryWebGLClippingRegion = require( 'WAVE_INTERFERENCE/common/view/SceneryWebGLClippingRegion' );
const SceneToggleNode = require( 'WAVE_INTERFERENCE/common/view/SceneToggleNode' );
const ScreenView = require( 'JOIST/ScreenView' );
const Shape = require( 'KITE/Shape' );
Expand Down Expand Up @@ -414,11 +413,7 @@ define( require => {
// Don't let the particles appear outside of the wave area. This works on the canvas layer but not webgl.
node.clipArea = Shape.bounds( this.waveAreaNode.bounds ).transformed( Matrix3.translation( -node.x, -node.y ) );

// WebGL doesn't support clipArea yet, this hack uses CSS clipping areas to achieve that effect.
// This hack relies on the fact that WebGL is only used to draw things in the wave area.
if ( useWebgl ) {
this.steppedEmitter.addListener( SceneryWebGLClippingRegion.createListener( model, node, this.waveAreaNode.bounds ) );
}
// Note: Clipping is not enabled on mobileSafari, see https://github.com/phetsims/wave-interference/issues/322
return node;
};

Expand Down

0 comments on commit 62ff503

Please sign in to comment.