Skip to content
Permalink
Browse files
Merge pull request #44740 from nirvn/atlas_fixes
A couple of atlas layout fixes
  • Loading branch information
nirvn committed Aug 19, 2021
2 parents 64b5ce1 + 2c5c9b6 commit 1706e7b2eeff4056cac638f97c594b6a62e5fbc2
@@ -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;
@@ -1948,6 +1948,13 @@ void QgsLayoutItemMapGrid::refreshDataDefinedProperties()
{
const QgsExpressionContext context = createExpressionContext();

// if we are changing the grid interval or offset, then we also have to mark the transform as dirty
mTransformDirty = mTransformDirty
|| mDataDefinedProperties.isActive( QgsLayoutObject::MapGridIntervalX )
|| mDataDefinedProperties.isActive( QgsLayoutObject::MapGridIntervalY )
|| mDataDefinedProperties.isActive( QgsLayoutObject::MapGridOffsetX )
|| mDataDefinedProperties.isActive( QgsLayoutObject::MapGridOffsetY );

mEvaluatedEnabled = mDataDefinedProperties.valueAsBool( QgsLayoutObject::MapGridEnabled, context, enabled() );
switch ( mGridUnit )
{
@@ -1975,6 +1982,7 @@ void QgsLayoutItemMapGrid::refreshDataDefinedProperties()
const double interval = QgsLayoutUtils::calculatePrettySize( minUnitsPerSeg, maxUnitsPerSeg );
mEvaluatedIntervalX = interval;
mEvaluatedIntervalY = interval;
mTransformDirty = true;
}
break;
}
@@ -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 1706e7b

Please sign in to comment.