diff --git a/src/3d/qgs3dmapscene.cpp b/src/3d/qgs3dmapscene.cpp index 69088a95c30ea..1804e5f267a63 100644 --- a/src/3d/qgs3dmapscene.cpp +++ b/src/3d/qgs3dmapscene.cpp @@ -697,6 +697,8 @@ void Qgs3DMapScene::addLayerEntity( QgsMapLayer *layer ) connect( sceneNewEntity, &Qgs3DMapSceneEntity::newEntityCreated, this, [this]( Qt3DCore::QEntity * entity ) { finalizeNewEntity( entity ); + // this ensures to update the near/far planes with the exact bounding box of the new entity. + updateCameraNearFarPlanes(); } ); connect( sceneNewEntity, &Qgs3DMapSceneEntity::pendingJobsCountChanged, this, &Qgs3DMapScene::totalPendingJobsCountChanged ); diff --git a/tests/testdata/control_images/3d/expected_polygon3d_extrusion_data_defined/expected_polygon3d_extrusion_data_defined_mask.png b/tests/testdata/control_images/3d/expected_polygon3d_extrusion_data_defined/expected_polygon3d_extrusion_data_defined_mask.png index 502ffc849dba6..409b8a0e31834 100644 Binary files a/tests/testdata/control_images/3d/expected_polygon3d_extrusion_data_defined/expected_polygon3d_extrusion_data_defined_mask.png and b/tests/testdata/control_images/3d/expected_polygon3d_extrusion_data_defined/expected_polygon3d_extrusion_data_defined_mask.png differ diff --git a/tests/testdata/control_images/3d/expected_polygon3d_extrusion_opacity/expected_polygon3d_extrusion_opacity_mask.png b/tests/testdata/control_images/3d/expected_polygon3d_extrusion_opacity/expected_polygon3d_extrusion_opacity_mask.png index 58286686aa92e..ff1d53031a90f 100644 Binary files a/tests/testdata/control_images/3d/expected_polygon3d_extrusion_opacity/expected_polygon3d_extrusion_opacity_mask.png and b/tests/testdata/control_images/3d/expected_polygon3d_extrusion_opacity/expected_polygon3d_extrusion_opacity_mask.png differ diff --git a/tests/testdata/control_images/3d/expected_rulebased/expected_rulebased_mask.png b/tests/testdata/control_images/3d/expected_rulebased/expected_rulebased_mask.png index 6d973fbf02687..547e64a32f807 100644 Binary files a/tests/testdata/control_images/3d/expected_rulebased/expected_rulebased_mask.png and b/tests/testdata/control_images/3d/expected_rulebased/expected_rulebased_mask.png differ