Skip to content

Commit

Permalink
Fix bug that happened after the last steam bubble was removed, see #191
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisklus committed Jan 25, 2019
1 parent d5a5e63 commit e56e4ab
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/common/view/SteamCanvasNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ define( function( require ) {
// // remove bubbles that have floated out of view
if ( this.containerOutlineRect.minY - this.steamBubbles[ i ].y > MAX_STEAM_BUBBLE_HEIGHT ) {
this.steamBubbles.splice( i, 1 );

// break out of this loop when the last steam bubble is removed
if ( this.steamBubbles.length < 1 ) {
break;
}
}

// update position of floating bubbles
Expand Down

0 comments on commit e56e4ab

Please sign in to comment.