Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NumberSpinner: add arrowButtonOptions, nested options for arrowButtons #620

Closed
pixelzoom opened this issue Sep 1, 2020 · 2 comments
Closed
Assignees

Comments

@pixelzoom
Copy link
Contributor

From phetsims/natural-selection#192 (comment):

I discovered that NumberSpinner has no way to dilate the pointer areas for its arrow buttons. Doing that properly involves adding nested options arrowButtonOptions to NumberSpinner, and fixing up every place where NumberSpinner is used. It will take at least 2 hours. @ariel-phet Do you want me to tackle that?

There are 12 occurrences of "import NumberSpinner" in the PhET code base.

@pixelzoom pixelzoom self-assigned this Sep 1, 2020
@pixelzoom
Copy link
Contributor Author

This section of code in NumberSpinner.js shows the options that need to be nested:

    // buttons
    const arrowButtonOptions = {
      baseColor: options.arrowButtonFill,
      stroke: options.arrowButtonStroke,
      lineWidth: options.arrowButtonLineWidth,
      focusable: false,

      // as requested in https://github.com/phetsims/sun/issues/575
      enabledPropertyOptions: {
        phetioReadOnly: true,
        phetioFeatured: false
      }
    };

@pixelzoom
Copy link
Contributor Author

Nevermind. I found these options that work for Natural Selection:

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

Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant