Skip to content

Commit e81e7e1

Browse files
ptitjanotroopa81
authored andcommittedApr 26, 2023
qgs3dmapconfigwidget: Fix zoom level update on init
When the configuration widget is displayed, the zoom level is computed by calling `onTerrainLayerChanged` in the constructor. This function calls `updateMaxZoomLevel` which takes care of updating the max zoom level. This function relies on `groupExtent` to get the tile resolution. However, on startup, this resolution is always zero because `groupExtent` has not been initialized yet. This issue is fixed by calling `onTerrainLayerChanged` after `groupExtent` initialization.
1 parent e400423 commit e81e7e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/app/3d/qgs3dmapconfigwidget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ Qgs3DMapConfigWidget::Qgs3DMapConfigWidget( Qgs3DMapSettings *map, QgsMapCanvas
172172

173173
groupMeshTerrainShading->layout()->addWidget( mMeshSymbolWidget );
174174

175-
onTerrainTypeChanged();
176-
177175
// ==================
178176
// Page: Skybox
179177
mSkyboxSettingsWidget = new QgsSkyboxRenderingSettingsWidget( this );
@@ -257,6 +255,8 @@ Qgs3DMapConfigWidget::Qgs3DMapConfigWidget( Qgs3DMapSettings *map, QgsMapCanvas
257255
mShowExtentIn2DViewCheckbox = new QCheckBox( tr( "Show in 2D map view" ) );
258256
mShowExtentIn2DViewCheckbox->setChecked( map->showExtentIn2DView() );
259257
groupExtent->layout()->addWidget( mShowExtentIn2DViewCheckbox );
258+
259+
onTerrainTypeChanged();
260260
}
261261

262262
Qgs3DMapConfigWidget::~Qgs3DMapConfigWidget()

0 commit comments

Comments
 (0)
Please sign in to comment.