Skip to content

Commit

Permalink
buttonWasAlreadySelected logic applies to Pen as well, see phetsims/s…
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg authored and zepumph committed Mar 3, 2021
1 parent 0ef21a5 commit 124a199
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions js/HomeScreenButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,13 @@ class HomeScreenButton extends VBox {

// If you touch an unselected button, it become selected. If then without lifting your finger you swipe over to the
// next button, that one becomes selected instead.
const onTouchLikeOver = () => {
buttonWasAlreadySelected = homeScreenModel.selectedScreenProperty.value === screen;
homeScreenModel.selectedScreenProperty.value = screen;
};
this.addInputListener( {
touchover: event => {
buttonWasAlreadySelected = homeScreenModel.selectedScreenProperty.value === screen;
homeScreenModel.selectedScreenProperty.value = screen;
}
touchover: onTouchLikeOver,
penover: onTouchLikeOver
} );

// set the mouseArea and touchArea to be the whole local bounds of this node, because if it just relies on the
Expand Down

0 comments on commit 124a199

Please sign in to comment.