phetsims / calculus-grapher

"Calculus Grapher" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
4 stars 4 forks source link

CurveManipulationWidthSlider PointerArea along track seems too small #282

Closed marlitas closed 1 year ago

marlitas commented 1 year ago

For https://github.com/phetsims/calculus-grapher/issues/268, I was examining the sim with showPointerAreas and noticed that I received a pointer along a very narrow portion of the track, so narrow that it would rapidly flip between cursor and pointer. This seems buggy, and may be a problem with Slider, as I did not see code in CurveManipulationWidthSlider that dictated pointer area.

https://user-images.githubusercontent.com/42476338/224839893-5f7ba058-1383-4bae-8b50-9eafe62c5915.mov

pixelzoom commented 1 year ago

The default Slider track is sized via SliderOptions.trackSize, and the cursor changes only when it's over the track. There's currently no option for dilating the default track's pointer area.

CurveManipulationWidthSlider.ts is setting a very narrow trackSize, which explains the behavior that you're seeing:

      trackSize: new Dimension2( 100, 1 ),

If I make this change:

-      trackSize: new Dimension2( 100, 1 ),
+      trackSize: new Dimension2( 100, 3 ),
+      trackFillEnabled: 'black',

then the track looks too "heavy":

screenshot_2417

I'll investigate adding options for dilation of track pointer areas to SliderOptions. But I'm hesitant to add more complexity to Slider, especially for a feature like this that I suspect is seldom used/discovered.

pixelzoom commented 1 year ago

Adding options to Slider is not going to happen, see gory details in https://github.com/phetsims/sun/issues/836.

My recommendation is "won't fix" for Calculus Grapher. But I'll let @amanda-phet make the final call. To summarize:

amanda-phet commented 1 year ago

I think we should not make any changes to the slider for this sim. I didn't even know the slider was clickable! Even so, making it thicker makes it look worse visually and still doesn't make the touch area acceptable.

If we want a larger touch area, it should be handled in Slider and not in this sim.