Skip to content

Commit

Permalink
Fix initial placement selection is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 20, 2020
1 parent f62c6d5 commit a462a17
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/gui/labeling/qgslabelinggui.cpp
Expand Up @@ -353,7 +353,16 @@ void QgsLabelingGui::setLayer( QgsMapLayer *mapLayer )

mCheckAllowLabelsOutsidePolygons->setChecked( mSettings.polygonPlacementFlags() & QgsLabeling::PolygonPlacementFlag::AllowPlacementOutsideOfPolygon );

mPlacementModeComboBox->setCurrentIndex( mPlacementModeComboBox->findData( mSettings.placement ) );
const int placementIndex = mPlacementModeComboBox->findData( mSettings.placement );
if ( placementIndex >= 0 )
{
mPlacementModeComboBox->setCurrentIndex( placementIndex );
}
else
{
// use default placement for layer type
mPlacementModeComboBox->setCurrentIndex( 0 );
}

// Label repeat distance
mRepeatDistanceSpinBox->setValue( mSettings.repeatDistance );
Expand Down

0 comments on commit a462a17

Please sign in to comment.