summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJean-Michaël Celerier <jean-michael.celerier@kdab.com>2019-11-26 10:58:08 +0100
committerJean-Michaël Celerier <jean-michael.celerier@kdab.com>2019-11-26 13:56:01 +0100
commit3f2e3403056fdafabade73e0590e24ea7f837ae2 (patch)
treeeef26fbae492b3fe929f32c790e44615dabc9889 /src
parent14fa593cd03c5259c2b744812ec64edaf6eb1385 (diff)
Fix a crash in Qt3DWindow when the window has no height
Change-Id: Iaf09d3ada0db25794ec6e517301d054641cb41a0 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/extras/defaults/qt3dwindow.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/extras/defaults/qt3dwindow.cpp b/src/extras/defaults/qt3dwindow.cpp
index ace40c3c1..04b8554f1 100644
--- a/src/extras/defaults/qt3dwindow.cpp
+++ b/src/extras/defaults/qt3dwindow.cpp
@@ -237,7 +237,7 @@ void Qt3DWindow::showEvent(QShowEvent *e)
void Qt3DWindow::resizeEvent(QResizeEvent *)
{
Q_D(Qt3DWindow);
- d->m_defaultCamera->setAspectRatio(float(width()) / float(height()));
+ d->m_defaultCamera->setAspectRatio(float(width()) / std::max(1.f, static_cast<float>(height())));
}
/*!