Skip to content
Permalink
Browse files
[layouts] Allow predefined scale for point layers to fix handling of …
…multipoint geometries
  • Loading branch information
nirvn committed Aug 18, 2021
1 parent 7eafc43 commit 8bc909892e89bb2c4efee6451194275395e94254
Showing with 3 additions and 4 deletions.
  1. +1 −1 src/core/layout/qgslayoutitemmap.cpp
  2. +2 −3 src/gui/layout/qgslayoutmapwidget.cpp
@@ -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;
@@ -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 );
}
}

0 comments on commit 8bc9098

Please sign in to comment.