Skip to content

Commit

Permalink
qgs3dmapconfigwidget: Fix zoom level update on init
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ptitjano authored and troopa81 committed Apr 26, 2023
1 parent e400423 commit e81e7e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/3d/qgs3dmapconfigwidget.cpp
Expand Up @@ -172,8 +172,6 @@ Qgs3DMapConfigWidget::Qgs3DMapConfigWidget( Qgs3DMapSettings *map, QgsMapCanvas

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

onTerrainTypeChanged();

// ==================
// Page: Skybox
mSkyboxSettingsWidget = new QgsSkyboxRenderingSettingsWidget( this );
Expand Down Expand Up @@ -257,6 +255,8 @@ Qgs3DMapConfigWidget::Qgs3DMapConfigWidget( Qgs3DMapSettings *map, QgsMapCanvas
mShowExtentIn2DViewCheckbox = new QCheckBox( tr( "Show in 2D map view" ) );
mShowExtentIn2DViewCheckbox->setChecked( map->showExtentIn2DView() );
groupExtent->layout()->addWidget( mShowExtentIn2DViewCheckbox );

onTerrainTypeChanged();
}

Qgs3DMapConfigWidget::~Qgs3DMapConfigWidget()
Expand Down

0 comments on commit e81e7e1

Please sign in to comment.