Skip to content

Commit

Permalink
migrate pointer-area options to Checkbox, phetsims/fourier-making-wav…
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Sep 21, 2021
1 parent 515df0c commit d276701
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions js/Checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ class Checkbox extends Node {
checkboxColorBackground: 'white',
disabledOpacity: SceneryConstants.DISABLED_OPACITY,

// pointer areas
touchAreaXDilation: 0,
touchAreaYDilation: 0,
mouseAreaXDilation: 0,
mouseAreaYDilation: 0,

// phet-io
tandem: Tandem.REQUIRED,
phetioEventType: EventType.USER,
Expand Down Expand Up @@ -152,6 +158,10 @@ class Checkbox extends Node {
// Apply additional options
this.mutate( options );

// pointer areas
this.touchArea = this.localBounds.dilatedXY( options.touchAreaXDilation, options.touchAreaYDilation );
this.mouseArea = this.localBounds.dilatedXY( options.mouseAreaXDilation, options.mouseAreaYDilation );

// pdom - to prevent a bug with NVDA and Firefox where the label sibling receives two click events, see
// https://github.com/phetsims/gravity-force-lab/issues/257
this.setExcludeLabelSiblingFromInput();
Expand Down

0 comments on commit d276701

Please sign in to comment.