Use absolute dimensions of viewport to calculate aspect ratio. Refs #856

* On vulkan the viewport height could be negative to flip the NDC, but
  we don't care about its sign only its magnitude to calculate the
  aspect ratio.
This commit is contained in:
baldurk
2018-02-02 17:29:12 +00:00
parent 4e830b247c
commit 96c487c8c0
+4 -1
View File
@@ -2283,8 +2283,11 @@ void BufferViewer::configureMeshColumns()
Viewport vp = m_Ctx.CurPipelineState().GetViewport(0);
float vpWidth = qAbs(vp.width);
float vpHeight = qAbs(vp.height);
m_Config.fov = ui->fovGuess->value();
m_Config.aspect = (vp.width > 0.0f && vp.height > 0.0f) ? (vp.width / vp.height) : 1.0f;
m_Config.aspect = (vpWidth > 0.0f && vpHeight > 0.0f) ? (vpWidth / vpHeight) : 1.0f;
m_Config.highlightVert = 0;
if(ui->aspectGuess->value() > 0.0)