-
Notifications
You must be signed in to change notification settings - Fork 341
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
Put back in "Merge pull request #489 from adroitwhiz/touching-white-fixes" #676
Conversation
…iz/touching-white-fixes""""
// If the color we're checking for is the background color, don't confine the check to | ||
// candidate drawables' bounds--since the background spans the entire stage, we must check | ||
// everything that lies inside the drawable. | ||
bounds = this._touchingBounds(drawableID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is here, touchingBounds can return null: https://github.com/LLK/scratch-render/blob/954cfff02b08069a082cbedd415c1fecd9b1e4fb/src/RenderWebGL.js#L1385
Then we reference bounds.width on line 792
I am trying to figure out why row 1 and column 1 of the background silhouette are full of transparent pixels (which are getting detected as white) and it's the rabbit hole |
Rabbit holes are actually not very deep or complicated? https://i.pinimg.com/originals/d9/cc/2a/d9cc2ab7fff45888ef3fef5fc5e92ed1.jpg |
I think the first row and column being detected as transparent is coming from floating point calculation issues. Here in sampleColor4b the localPosition is coming out to barely < 0, so it's returning transparent. Edit: I was having a lot of frustration testing using Blue Sky 2, but I realized it actually is offset from the left. It has transparent padding all around and a viewbox that starts at x < 0, y < 0 Edit: filed #688 for this |
ab8907a
to
72b320f
Compare
72b320f
to
5fa9c76
Compare
"Touches the colorfully bent semi-transparent crab" is failing |
I was comparing some of this code to #479 and I think the best approach might be to first merge that PR then look at this again. I think the way that #479 does the texture clamping in the |
Hmm, another idea that might be worth trying: what happens if you just remove the clamping in |
The colorfully bent semi-transparent crab has spoken and it is Not Ok |
src/Drawable.js
Outdated
if (localPosition[0] < 0 || localPosition[1] < 0 || | ||
localPosition[0] > 1 || localPosition[1] > 1) { | ||
dst[0] = 0; | ||
dst[1] = 0; | ||
dst[2] = 0; | ||
dst[3] = 0; | ||
return dst; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So... it turns out I steered you wrong when I recommended removing this. I was thinking about texture coordinates being out of range (which should be and is handled at the Silhouette layer) when I should have been thinking about geometric coordinates being out of range (which is what this if
handles). I think bringing this back in will fix the crab test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I'm glad the crab is pleased 🦀
@@ -34,7 +34,7 @@ | |||
"eslint": "^4.6.1", | |||
"eslint-config-scratch": "^5.0.0", | |||
"gh-pages": "^1.0.0", | |||
"jsdoc": "^3.5.5", | |||
"jsdoc": "^3.6.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to add "resolves #680" to the PR description... at least I think that's what this is...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I broke this out into #683
Reverts #674
Fixes #680