Skip to content

Commit

Permalink
only apply elevation offset for Z attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
NEDJIMAbelgacem authored and nyalldawson committed Jan 17, 2021
1 parent 912786e commit 1b19b7b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/app/3d/qgspointcloud3dsymbolwidget.cpp
Expand Up @@ -468,10 +468,13 @@ void QgsPointCloud3DSymbolWidget::rampAttributeChanged()
mProviderMax = std::numeric_limits< double >::quiet_NaN();
}

const double zScale = static_cast< const QgsPointCloudLayerElevationProperties * >( mLayer->elevationProperties() )->zScale();
const double zOffset = static_cast< const QgsPointCloudLayerElevationProperties * >( mLayer->elevationProperties() )->zOffset();
mProviderMin = mProviderMin * zScale + zOffset;
mProviderMax = mProviderMax * zScale + zOffset;
if ( mRenderingParameterComboBox->currentAttribute() == QStringLiteral( "Z" ) )
{
const double zScale = static_cast< const QgsPointCloudLayerElevationProperties * >( mLayer->elevationProperties() )->zScale();
const double zOffset = static_cast< const QgsPointCloudLayerElevationProperties * >( mLayer->elevationProperties() )->zOffset();
mProviderMin = mProviderMin * zScale + zOffset;
mProviderMax = mProviderMax * zScale + zOffset;
}
}
mScalarRecalculateMinMaxButton->setEnabled( !std::isnan( mProviderMin ) && !std::isnan( mProviderMax ) );
emitChangedSignal();
Expand Down

0 comments on commit 1b19b7b

Please sign in to comment.