Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fix uncaught exception when calculating full extent (fixes #40683)
- Loading branch information
Showing
with
10 additions
and
3 deletions.
-
+10
−3
src/core/qgsprojectviewsettings.cpp
|
@@ -101,10 +101,17 @@ QgsReferencedRectangle QgsProjectViewSettings::fullExtent() const |
|
|
// layer. The extent must be projected to the canvas CS |
|
|
QgsCoordinateTransform ct( it.value()->crs(), mProject->crs(), mProject->transformContext() ); |
|
|
ct.setBallparkTransformsAreAppropriate( true ); |
|
|
const QgsRectangle extent = ct.transformBoundingBox( it.value()->extent() ); |
|
|
try |
|
|
{ |
|
|
const QgsRectangle extent = ct.transformBoundingBox( it.value()->extent() ); |
|
|
|
|
|
QgsDebugMsgLevel( "Output extent: " + extent.toString(), 5 ); |
|
|
fullExtent.combineExtentWith( extent ); |
|
|
QgsDebugMsgLevel( "Output extent: " + extent.toString(), 5 ); |
|
|
fullExtent.combineExtentWith( extent ); |
|
|
} |
|
|
catch ( QgsCsException & ) |
|
|
{ |
|
|
QgsDebugMsg( QStringLiteral( "Could not reproject layer extent" ) ); |
|
|
} |
|
|
} |
|
|
|
|
|
if ( fullExtent.width() == 0.0 || fullExtent.height() == 0.0 ) |
|
|