Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incorrect use of std::numeric_limits<double>::min() in 3d height …
Browse files Browse the repository at this point in the history
…range calculation
nyalldawson authored and github-actions[bot] committed Aug 1, 2022
1 parent 3e73549 commit 383e68c
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/3d/qgs3dutils.cpp
Original file line number Diff line number Diff line change
@@ -531,7 +531,7 @@ void Qgs3DUtils::estimateVectorLayerZRange( QgsVectorLayer *layer, double &zMin,
}

zMin = std::numeric_limits<double>::max();
zMax = std::numeric_limits<double>::min();
zMax = std::numeric_limits<double>::lowest();

QgsFeature f;
QgsFeatureIterator it = layer->getFeatures( QgsFeatureRequest().setNoAttributes().setLimit( 100 ) );
@@ -546,7 +546,7 @@ void Qgs3DUtils::estimateVectorLayerZRange( QgsVectorLayer *layer, double &zMin,
}
}

if ( zMin == std::numeric_limits<double>::max() && zMax == std::numeric_limits<double>::min() )
if ( zMin == std::numeric_limits<double>::max() && zMax == std::numeric_limits<double>::lowest() )
{
zMin = 0;
zMax = 0;
2 changes: 1 addition & 1 deletion src/3d/qgsvectorlayerchunkloader_p.cpp
Original file line number Diff line number Diff line change
@@ -130,7 +130,7 @@ Qt3DCore::QEntity *QgsVectorLayerChunkLoader::createEntity( Qt3DCore::QEntity *p
mHandler->finalize( entity, mContext );

// fix the vertical range of the node from the estimated vertical range to the true range
if ( mHandler->zMinimum() != std::numeric_limits<float>::max() && mHandler->zMaximum() != std::numeric_limits<float>::min() )
if ( mHandler->zMinimum() != std::numeric_limits<float>::max() && mHandler->zMaximum() != std::numeric_limits<float>::lowest() )
{
QgsAABB box = mNode->bbox();
box.yMin = mHandler->zMinimum();

0 comments on commit 383e68c

Please sign in to comment.