Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[layouts] Allow predefined scale for point layers to fix handling of …
…multipoint geometries
  • Loading branch information
nirvn authored and nyalldawson committed Aug 19, 2021
1 parent 734db2b commit 7165ef6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/core/layout/qgslayoutitemmap.cpp
Expand Up @@ -2642,7 +2642,7 @@ void QgsLayoutItemMap::updateAtlasFeature()
else
scales = mLayout->renderContext().predefinedScales();
Q_NOWARN_DEPRECATED_POP
if ( mAtlasScalingMode == Fixed || isPointLayer || scales.isEmpty() )
if ( mAtlasScalingMode == Fixed || scales.isEmpty() || ( isPointLayer && mAtlasScalingMode != Predefined ) )
{
// only translate, keep the original scale (i.e. width x height)
double xMin = geomCenterX - originalExtent.width() / 2.0;
Expand Down
5 changes: 2 additions & 3 deletions src/gui/layout/qgslayoutmapwidget.cpp
Expand Up @@ -947,15 +947,14 @@ void QgsLayoutMapWidget::toggleAtlasScalingOptionsByLayerType()
if ( QgsWkbTypes::geometryType( layer->wkbType() ) == QgsWkbTypes::PointGeometry )
{
//For point layers buffer setting makes no sense, so set "fixed scale" on and disable margin control
mAtlasFixedScaleRadio->setChecked( true );
if ( mMapItem->atlasScalingMode() == QgsLayoutItemMap::Auto )
mAtlasFixedScaleRadio->setChecked( true );
mAtlasMarginRadio->setEnabled( false );
mAtlasPredefinedScaleRadio->setEnabled( false );
}
else
{
//Not a point layer, so enable changes to fixed scale control
mAtlasMarginRadio->setEnabled( true );
mAtlasPredefinedScaleRadio->setEnabled( true );
}
}

Expand Down

0 comments on commit 7165ef6

Please sign in to comment.