Skip to content
Permalink
Browse files

Merge pull request #6909 from pvalsecc/fix_crssync

Fix crssync crash during build
  • Loading branch information
sbrunner committed May 2, 2018
2 parents 8f9a378 + d6b1f49 commit cbf70a4da24ede99c05788eb91ecb738ff2450b9
Showing with 9 additions and 6 deletions.
  1. +9 −6 src/core/qgscolorschemeregistry.cpp
@@ -117,12 +117,15 @@ void QgsColorSchemeRegistry::setRandomStyleColorScheme( QgsColorScheme *scheme )
{
mRandomStyleColors = scheme->fetchColors();

std::random_device rd;
std::mt19937 mt( rd() );
std::uniform_int_distribution<int> colorDist( 0, mRandomStyleColors.count() - 1 );
mNextRandomStyleColorIndex = colorDist( mt );
std::uniform_int_distribution<int> colorDir( 0, 1 );
mNextRandomStyleColorDirection = colorDir( mt ) == 0 ? -1 : 1;
if ( mRandomStyleColors.count() > 0 )
{
std::random_device rd;
std::mt19937 mt( rd() );
std::uniform_int_distribution<int> colorDist( 0, mRandomStyleColors.count() - 1 );
mNextRandomStyleColorIndex = colorDist( mt );
std::uniform_int_distribution<int> colorDir( 0, 1 );
mNextRandomStyleColorDirection = colorDir( mt ) == 0 ? -1 : 1;
}
}
else
{

0 comments on commit cbf70a4

Please sign in to comment.
You can’t perform that action at this time.