Skip to content

Commit

Permalink
toolbox visible bug, #219
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Feb 27, 2020
1 parent a00bf85 commit 60b7a0e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/common/view/ToolboxPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ define( require => {

// listens to the isUserControlled Property of the dataProbe tool
// return the dataProbe to the toolboxPanel if not user Controlled and its position is located within the toolbox panel
dataProbeNode.isUserControlledProperty.lazyLink( function( isUserControlled ) {
dataProbeNode.isUserControlledProperty.lazyLink( isUserControlled => {
assert && assert( dataProbeNode.parent instanceof ScreenView );
assert && assert( dataProbeNode.parent === self.parent );

const dataProbeNodeBounds = dataProbeNode.getJustDataProbeBounds(); //globalToParentBounds( dataProbeNode.getGlobalBounds() );
const toolboxBounds = dataProbeNode.globalToParentBounds( self.getGlobalBounds() );
if ( !isUserControlled && toolboxBounds.intersectsBounds( dataProbeNodeBounds.eroded( 5 ) ) ) {
if ( !isUserControlled && this.visible && toolboxBounds.intersectsBounds( dataProbeNodeBounds.eroded( 5 ) ) ) {
dataProbe.isActiveProperty.set( false );
}
} );
Expand Down Expand Up @@ -103,7 +103,7 @@ define( require => {

const tapeBaseBounds = measuringTapeNode.localToParentBounds( measuringTapeNode.getLocalBaseBounds() );
const toolboxBounds = measuringTapeNode.globalToParentBounds( self.getGlobalBounds() );
if ( !isUserControlled && toolboxBounds.intersectsBounds( tapeBaseBounds.eroded( 5 ) ) ) {
if ( !isUserControlled && this.visible && toolboxBounds.intersectsBounds( tapeBaseBounds.eroded( 5 ) ) ) {
measuringTape.isActiveProperty.set( false );
}
} );
Expand Down

0 comments on commit 60b7a0e

Please sign in to comment.