Commit 249c6fc 1 parent 5360b79 commit 249c6fc Copy full SHA for 249c6fc
File tree 1 file changed +13
-8
lines changed
1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -428,15 +428,20 @@ void QgsMapCanvasDockWidget::updateExtentRect()
428
428
// close polygon
429
429
mainCanvasPoly << mainCanvasPoly.at ( 0 );
430
430
QgsGeometry g = QgsGeometry::fromQPolygonF ( mainCanvasPoly );
431
- // reproject extent
432
- QgsCoordinateTransform ct ( mMainCanvas ->mapSettings ().destinationCrs (),
433
- mMapCanvas ->mapSettings ().destinationCrs () );
434
- try
435
- {
436
- g.transform ( ct );
437
- }
438
- catch ( QgsCsException & )
431
+ if ( mMainCanvas ->mapSettings ().destinationCrs () !=
432
+ mMapCanvas ->mapSettings ().destinationCrs () )
439
433
{
434
+ // reproject extent
435
+ QgsCoordinateTransform ct ( mMainCanvas ->mapSettings ().destinationCrs (),
436
+ mMapCanvas ->mapSettings ().destinationCrs () );
437
+ g = g.densifyByCount ( 5 );
438
+ try
439
+ {
440
+ g.transform ( ct );
441
+ }
442
+ catch ( QgsCsException & )
443
+ {
444
+ }
440
445
}
441
446
mExtentRubberBand ->setToGeometry ( g, nullptr );
442
447
}
You can’t perform that action at this time.
0 commit comments