Skip to content
Permalink
Browse files

Merge pull request #41769 from elpaso/bugfix-gh41747-paletted-float-r…

…amp-order

Fix raster paletted ramp order
  • Loading branch information
elpaso authored and github-actions committed Feb 23, 2021
1 parent ab59e37 commit b492490b8aeeab6d32306c21886df44039a2b9af
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/core/raster/qgspalettedrasterrenderer.cpp
@@ -566,6 +566,11 @@ QgsPalettedRasterRenderer::ClassData QgsPalettedRasterRenderer::classDataFromRas
}
}
}
// must be sorted
std::sort( data.begin(), data.end(), []( const Class & a, const Class & b ) -> bool
{
return a.value < b.value;
} );
}
else
{
@@ -600,7 +605,7 @@ QgsPalettedRasterRenderer::ClassData QgsPalettedRasterRenderer::classDataFromRas
}

// assign colors from ramp
if ( ramp )
if ( ramp && numClasses > 0 )
{
int i = 0;

0 comments on commit b492490

Please sign in to comment.