Commit f56d258c authored by Jan Möbius's avatar Jan Möbius

Dennis: Use only real aspect ratio if widget has a size.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6974 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 86916883
......@@ -345,17 +345,24 @@ void glViewer::updateProjectionMatrix()
// In scereo mode we have to use a perspective matrix
if (stereo_ || projectionMode_ == PERSPECTIVE_PROJECTION)
{
glstate_->perspective(fovy_, (GLdouble) glWidth() / (GLdouble) glHeight(),
double aspect;
if (isVisible() && glWidth() && glHeight())
aspect = (double) glWidth() / (double) glHeight();
else
aspect = 1.0;
glstate_->perspective(fovy_, (GLdouble) aspect,
near_, far_);
}
else
{
double aspect;
if (isVisible())
if (isVisible() && glWidth() && glHeight())
aspect = (double) glWidth() / (double) glHeight();
else
aspect = 1.0;
aspect = 1.0;
glstate_->ortho( -orthoWidth_, orthoWidth_,
-orthoWidth_/aspect, orthoWidth_/aspect,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment