Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
restore "stretch using current extent" functionality in layer context
menu (fix #7070)
  • Loading branch information
alexbruy committed Mar 14, 2013
1 parent fb94952 commit 5ecb268
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/legend/qgslegend.cpp
Expand Up @@ -2775,7 +2775,10 @@ void QgsLegend::legendLayerStretchUsingCurrentExtent()
layer->setContrastEnhancementAlgorithm( "StretchToMinimumMaximum" );
}

layer->setMinimumMaximumUsingLastExtent();
QgsRectangle myRectangle;
myRectangle = mMapCanvas->mapRenderer()->outputExtentToLayerExtent( layer, mMapCanvas->extent() );
layer->setContrastEnhancementAlgorithm( layer->contrastEnhancementAlgorithm(), QgsRasterLayer::ContrastEnhancementMinMax, myRectangle );

layer->setCacheImage( NULL );
refreshLayerSymbology( layer->id() );
mMapCanvas->refresh();
Expand Down

0 comments on commit 5ecb268

Please sign in to comment.