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

"is touching" reporting false negatives on tiny tests #719

Open
cwillisf opened this issue Nov 4, 2020 · 8 comments
Open

"is touching" reporting false negatives on tiny tests #719

cwillisf opened this issue Nov 4, 2020 · 8 comments

Comments

@cwillisf
Copy link
Contributor

cwillisf commented Nov 4, 2020

Expected Behavior

is touching tests should not depend on the size of the objects in question or the size of the stage

Actual Behavior

This project behaves differently on staging vs production:

  • Production: scratch.mit.edu/projects/445335326
  • Staging: 1300006793

As of this test, the two environments differ only by these two changes:

Steps to Reproduce

  1. Load the project
  2. Use WASD to move the cat onto & off of the purple dot
  3. The cat should report "true" when overlapping the dot, and "false" when not

Actual behavior:

  • in some cases on staging, the cat always reports "false"
  • switching to full-screen stage and back may fix the issue
  • the issue might depend on whether Scratch is running on a high-DPI screen or not

Operating System and Browser

Seems to affect multiple browsers but Windows Chrome is the most-confirmed case so far.

@cwillisf
Copy link
Contributor Author

cwillisf commented Nov 5, 2020

After further testing, I think this is an existing issue that isn't specifically related to #557 or #624. In particular, I've tried this test project on many versions, going back into September, and I get "wrong" (always "false") results on all versions I've tested.

Here's the test project I've been using, from @BryceLTaylor (rename to SB3):
Touching Color.zip

@fsih
Copy link
Contributor

fsih commented Nov 5, 2020

I found that if I save the staging project to my computer, then re-upload it to scratch.mit.edu, it also always shows false. And vice versa, if I save the scratch.mit.edu project to my computer, and re-upload it to staging, it also shows true when I'm over the dot. I think the two projects are different

@fsih
Copy link
Contributor

fsih commented Nov 5, 2020

The not touching project on scratch.mit.edu:
dot2
The touching project on scratch.ly:
dot

@fsih
Copy link
Contributor

fsih commented Nov 5, 2020

The two purple dot costumes do differ
Screen Shot 2020-11-04 at 22 07 47
Here's a project where you can switch between them and change the touching behavior (on either staging or prod)
https://scratch.mit.edu/projects/445446223/editor
I guess the slight translation makes the two rasterize differently

@fsih
Copy link
Contributor

fsih commented Nov 5, 2020

tangentially, what's up with those NaNs

@cwillisf
Copy link
Contributor Author

cwillisf commented Nov 5, 2020

Thanks for figuring this out!

Also: I feel like "what's up with those NaNs" is the topic about 90% of the time when NaN comes up in a conversation.

@BryceLTaylor
Copy link

I'm not sure how those costumes became different. I just downloaded the project from staging and uploaded it to production without changing it.

@cwillisf
Copy link
Contributor Author

cwillisf commented Nov 5, 2020

Yeah - it seems possible that we have another bug in here related to costumes' bounds being slightly different on initial save vs. import & save again. Maybe the fix-up code that we run on import can cause small errors like this.

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

3 participants