Closed mramato closed 12 years ago
Looks like the resize handler is still getting called, and a correct new aspect ratio is being computed but not used.
Here's another way to reproduce: Start the CesiumViewer app in a wide browser window, then click the '2D' button, then shrink the window to be thin. At first it shows signs of working, but then there's a black frame flash, and then it shows a stretched map as if the aspect ratio is unchanged from the default.
After the bug shows, changing out of 2D mode back to 3D, shows the wrong aspect only until the next resize event happens, at which point the correct resize behavior resumes.
@bagnell can you take a look at why 2D mode might sometimes use a constant aspectRatio while 3D & Columbus mode use a computed aspectRatio?
@emackey In 2D, we use an orthographic projection which doesn't have an aspectRatio
property so the top
, and bottom
distances have to be adjusted. The right
and left
remain constant at +/- half the circumference of the earth at the equator.
This is fixed by #220.
The aspect ratio is now screwed and the map is all stretched out. Even switching back to 3D now shows an oblong globe.