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

Dragging function under pointer tool does not change color of pointer tool #81

Closed
megan-phet opened this issue Oct 19, 2018 · 17 comments
Closed

Comments

@megan-phet
Copy link

Test Device

  • Macbook Pro

Operating System

  • macOS 10.13.6

Browser

  • Safari
  • Firefox
  • Does not occur in Chrome

Problem Description

For phetsims/qa#211. If a pointer tool is not on top of a function and a function is dragged under the pointer tool, the pointer tool will not change color.

Steps to Reproduce

  1. Place pointer tool somewhere.
  2. Drag a function underneath the pointer tool. (The pointer tool won't change color.)

Visuals

kapture 2018-10-19 at 17 10 54

Troubleshooting Information Name: ‪Graphing Quadratics‬ URL: https://phet-dev.colorado.edu/html/graphing-quadratics/1.0.0-dev.38/phet/graphing-quadratics_en_phet.html Version: 1.0.0-dev.38 2018-10-18 21:15:53 UTC Features missing: touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Safari/605.1.15 Language: en-US Window: 1105x676 Pixel Ratio: 2/1 WebGL: WebGL 1.0 (2.1 INTEL-10.36.19) GLSL: WebGL GLSL ES 1.0 (1.20) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 15 uniform: 1024 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 16) Max viewport: 8192x8192 OES_texture_float: true Dependencies JSON: {"assert":{"sha":"928741cf","branch":"master"},"axon":{"sha":"644353d6","branch":"master"},"brand":{"sha":"1fd6682e","branch":"master"},"chipper":{"sha":"fc5919bb","branch":"master"},"dot":{"sha":"dcccfddd","branch":"master"},"graphing-lines":{"sha":"08b2b43e","branch":"master"},"graphing-quadratics":{"sha":"9b807638","branch":"master"},"joist":{"sha":"b12072c7","branch":"master"},"kite":{"sha":"380cef53","branch":"master"},"phet-core":{"sha":"269c4c8a","branch":"master"},"phet-io":{"sha":"ce77e241","branch":"master"},"phet-io-wrapper-classroom-activity":{"sha":"534dc595","branch":"master"},"phet-io-wrapper-hookes-law-energy":{"sha":"3372700d","branch":"master"},"phet-io-wrapper-lab-book":{"sha":"09507f4d","branch":"master"},"phet-io-wrappers":{"sha":"0a4a3153","branch":"master"},"phetcommon":{"sha":"a2a1aaba","branch":"master"},"query-string-machine":{"sha":"9ae63aab","branch":"master"},"scenery":{"sha":"d7e6c53e","branch":"master"},"scenery-phet":{"sha":"344597e6","branch":"master"},"sherpa":{"sha":"0989d371","branch":"master"},"sun":{"sha":"289fce23","branch":"master"},"tambo":{"sha":"fe63321c","branch":"master"},"tandem":{"sha":"2c4b970a","branch":"master"}}
@megan-phet
Copy link
Author

Another example.
kapture 2018-10-19 at 19 08 31

@pixelzoom
Copy link
Contributor

Point tools only change color with they are <= 0.01 units from the nearest point on a curve. When you're dragging a point tool, it will snap to a curve and will therefore satisfy this criteria. If the point tool is not being dragged and the curve moves, then the point tool will only change color if its location meets the <= 0.01 units criteria. Snapping the point tool to the curve when the point tool is not being dragged was an option that I explored, but that was problematic - it caused the point tools that were not being dragged to "follow" a curve as it moved.

@amanda-phet please review and indicate whether you'd like the current behavior to change.

@pixelzoom
Copy link
Contributor

Changing label from bug to design, because this is currently working as intended.

@pixelzoom
Copy link
Contributor

We could probably address this by changing 0.01 to some larger number.

@KatieWoe
Copy link
Contributor

@pixelzoom I think what might have been seen was that the color doesn't always change, even when you are very close, or passing through the spot. I think this is because the distance between the pointer and the line is larger than it looks, and the line is skipping past that point when being dragged. I positioned just right the pointer does change color. So I agree that this a design question. Here is a video of what I think was showing up.
orange

@amanda-phet
Copy link
Contributor

It seems like if the curve is passing through the point tool, the point tool should flicker orange/black at that moment. In @KatieWoe 's video it seems odd that it doesn't show the point when the parabola passes through the point tool. Is it because the coordinate values are to the nearest tenth, but the criteria for the point tool to change color is that the coordinates are more precise than that (to the nearest 0.01)?

@KatieWoe
Copy link
Contributor

Another note: the pointer tool is less likely to flash if the slider/curve is moving quickly.

@pixelzoom
Copy link
Contributor

pixelzoom commented Oct 23, 2018

It seems like if the curve is passing through the point tool, the point tool should flicker orange/black at that moment.

The curve is not changing continuously, it is changing discretely. So there is nothing "passing through" the point tool. The point tool is measuring whatever is within 0.01 units of it after the quadratic(s) have changed. If you want to track the before/after state of each curve and compute whether any curve passed through a point tool, that is an entirely different (and more complicated) implementation.

@amanda-phet
Copy link
Contributor

That makes sense. I think we should leave this as-is, since there is no actual bug present, and this did not come up in interviews.

@pixelzoom
Copy link
Contributor

Reopening. I think it might be worth increasing the tolerance from 0.01 to 0.1, and seeing how that feels. Would that be OK to try?

@pixelzoom pixelzoom reopened this Oct 23, 2018
@amanda-phet
Copy link
Contributor

Sure, that's fine with me.

@KatieWoe
Copy link
Contributor

@pixelzoom I'd be willing to do some comparisons. See if that's too far and feels off, or if it works. Either way. Let me know if you have a new dev build or want it tested on master.

pixelzoom added a commit that referenced this issue Oct 24, 2018
Signed-off-by: Chris Malley <cmalley@pixelzoom.com>
@pixelzoom pixelzoom assigned KatieWoe and unassigned pixelzoom Oct 24, 2018
@pixelzoom
Copy link
Contributor

pixelzoom commented Oct 24, 2018

@amanda-phet @KatieWoe In 1.0.0-dev.39, I added a pointToolThreshold query parameter. The default value is 0.1, in graph units. The point tool will be considered ON a curve if its distance to the curve is <= pointToolThreshold. Feel free to experiment with other values, but 0.1 seems to work pretty well.

@KatieWoe
Copy link
Contributor

KatieWoe commented Oct 24, 2018

@pixelzoom @amanda-phet I just took a look and the pointer does indicate when the line is passing through it most of the time. It doesn't if you'r moving the line very fast, but I doubt there's anything to do about that. There is the trade-off that @pixelzoom mentioned where the pointer tool may be further from the line when it turns on. See the image. I don't think it looks too bad, and the previous version had instances where the pointer tool looked like it was in the center of the line but didn't light up. I'll look for any instances that look off, but for now this is the furthest I've seen from the center.
far
Update: I haven't found anything further off than this.

@pixelzoom
Copy link
Contributor

pixelzoom commented Oct 24, 2018

The point tool doesn't need to be directly in the center of the line in these situations. As long as the coordinates shown by the point tool are actually on the line, then we're good. Since the precision of the point tool is 0.1, using pointToolThreshold: 0.1 should be good.

@amanda-phet
Copy link
Contributor

I didn't play with other values but 0.1 is looking good to me!

@amanda-phet
Copy link
Contributor

Kathy agrees that the threshold is working well. Closing.

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

4 participants