summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJean-Michaël Celerier <jean-michael.celerier@kdab.com>2019-11-26 10:48:12 +0100
committerJean-Michaël Celerier <jean-michael.celerier@kdab.com>2019-11-26 13:55:55 +0100
commit14fa593cd03c5259c2b744812ec64edaf6eb1385 (patch)
tree3dea9ac2d569fdbc4846258f6b213b143e0a81da /src
parent31d3ebed75387b09645fe3f1d36e3b30f686fce3 (diff)
Fix a crash in Qt3DQuickWindow when the window has no height
Change-Id: I74722f690b0b174b631e923f6760cbc1af396518 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/quick3d/quick3dextras/qt3dquickwindow.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick3d/quick3dextras/qt3dquickwindow.cpp b/src/quick3d/quick3dextras/qt3dquickwindow.cpp
index d67dfdc71..043aca8b9 100644
--- a/src/quick3d/quick3dextras/qt3dquickwindow.cpp
+++ b/src/quick3d/quick3dextras/qt3dquickwindow.cpp
@@ -276,7 +276,7 @@ void Qt3DQuickWindow::updateCameraAspectRatio()
Q_D(Qt3DQuickWindow);
if (d->m_camera) {
d->m_camera->setAspectRatio(static_cast<float>(width()) /
- static_cast<float>(height()));
+ std::max(1.f, static_cast<float>(height())));
}
}