-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Refactored ViewportQuadSpec #2987
Conversation
|
||
us = context.uniformState; | ||
us.update(context, createFrameState(createCamera())); | ||
scene.primitives.add(viewportQuad); |
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 suggest writing
viewportQuad = new ViewportQuad();
scene.primitives.add(viewportQuad);
as
viewportQuad = scene.primitives.add(new ViewportQuad());
This code was written before add
returned the added primitive.
Don't use Instead of adding the primitive in expect(scene.renderForSpecs()).toEqual([0, 0, 0, 255]);
scene.primitives.add(viewportQuad);
expect(scene.renderForSpecs()).not.toEqual([0, 0, 0, 255]); which, of course, makes my tip above not useful. |
Updated. |
viewportQuad.rectangle = undefined; | ||
|
||
expect(function() { | ||
render(context, frameState, viewportQuad); | ||
scene.primitives.add(viewportQuad); |
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.
Only put the part that we expect to throw in the callback so, here and below, move this above:
scene.primitives.add(viewportQuad);
Just that minor comment. |
Done |
Breathtaking. |
For #1259
There's an issue where
ClearCommand.ALL.execute(context)
doesn't seem to do anything, and instead the clear color ends up being the scene's background color (0,0,0,255). I noticed other specs account for this, like TextureAtlasSpec.I'm going to look into this more, but decided to start the pull request anyways.