Skip to content

Commit 65a3d70

Browse files
author
timlinux
committed
Fix but where layer does not refresh when applying local histogram stretch and render caching is enabled. Also update legend pixmap if performing a local stretch
git-svn-id: http://svn.osgeo.org/qgis/trunk@15190 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 569f342 commit 65a3d70

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/app/legend/qgslegend.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,6 +1712,8 @@ void QgsLegend::legendLayerStretchUsingCurrentExtent()
17121712
QgsRasterLayer *layer = qobject_cast<QgsRasterLayer *>( currentLayer->layer() );
17131713
if ( layer )
17141714
{
1715+
// Note: Do we really want to do these next clauses? The user will get a surprise when the
1716+
// drawing style they are using suddenly changes....! TS
17151717
if ( layer->drawingStyle() == QgsRasterLayer::SingleBandPseudoColor )
17161718
{
17171719
layer->setDrawingStyle( QgsRasterLayer::SingleBandGray );
@@ -1727,6 +1729,8 @@ void QgsLegend::legendLayerStretchUsingCurrentExtent()
17271729
}
17281730

17291731
layer->setMinimumMaximumUsingLastExtent();
1732+
layer->setCacheImage(NULL);
1733+
refreshLayerSymbology( layer->getLayerID() );
17301734
mMapCanvas->refresh();
17311735
}
17321736
}

0 commit comments

Comments
 (0)