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

Fix can't read x of undefined when getting window coordinates #4022

Merged
merged 2 commits into from
Jun 15, 2016
Merged

Fix can't read x of undefined when getting window coordinates #4022

merged 2 commits into from
Jun 15, 2016

Conversation

bmcallis
Copy link
Contributor

In certain situations, 2D mode and zoomed out far, calling
SceneTransforms.wgs84ToWindowCoordinates without passing in a result
object results in "TypeError: Cannot read property 'x' of undefined".

In certain situations, 2D mode and zoomed out far, calling
SceneTransforms.wgs84ToWindowCoordinates without passing in a result
object results in "TypeError: Cannot read property 'x' of undefined".
@@ -192,4 +192,19 @@ defineSuite([
expect(drawingBufferCoordinates.x).toBeLessThan(1.0);
expect(drawingBufferCoordinates.y).toBeLessThan(1.0);
});

it('should not error when zoomed out and in 2D', function(done) {
var scene = createScene();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to create a new scene instead of using the one that was created in the beforeAll block because changes I made to it were impacting other tests. I can update this spec be a little less fragile by creating the scene in the beforeEach instead of just once if that's preferred.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating a Scene for this test is fine, but you need to call destroyForSpecs afterwards to release all WebGL resources.

@bagnell
Copy link
Contributor

bagnell commented Jun 14, 2016

That's the only comment. Thanks @bmcallis!

@bagnell
Copy link
Contributor

bagnell commented Jun 14, 2016

Also, could you update CHANGES.md?

@bagnell bagnell merged commit d6941cc into CesiumGS:master Jun 15, 2016
@nmschulte-aviture nmschulte-aviture deleted the bugfix/sceneTransform-error branch November 8, 2019 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants