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

Touch area overlap of FineCoarseSpinner buttons #459

Closed
jessegreenberg opened this issue Jan 22, 2019 · 3 comments
Closed

Touch area overlap of FineCoarseSpinner buttons #459

jessegreenberg opened this issue Jan 22, 2019 · 3 comments

Comments

@jessegreenberg
Copy link
Contributor

From #450 and phetsims/forces-and-motion-basics#274. With default options, there is a slight overlap in the touch areas of adjacent ArrowButtons of the FineCoarseSpinner.
image

Overlap becomes greater if spacing is reduced. In forces-and-motion-basics, there was a special shape to get around this.

    // define custom touch areas so the arrow buttons don't overlap
    var doubleLeftShape = new Shape.rect( 0, -ARROW_TOUCH_DILATION, doubleLeftArrowButton.width + ARROW_TOUCH_DILATION, doubleLeftArrowButton.height + 2 * ARROW_TOUCH_DILATION );
    doubleLeftArrowButton.touchArea = doubleLeftShape;

Should something similar be added to FineCoarseSpinner?

@pixelzoom
Copy link
Contributor

This is due to the non-general default dilation in ArrowButton:

      touchAreaXDilation: 7,
      touchAreaYDilation: 7,

@pixelzoom
Copy link
Contributor

Done. The defaults pointer areas for the ArrowButtons are:

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

Here's how it looks in the Components screen of scenery-phet demo with ?showPointerAreas:

screenshot_1004

@jessegreenberg ready for review.

@jessegreenberg
Copy link
Contributor Author

Overlap is gone, thanks.

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

No branches or pull requests

2 participants