Fix initialization of COLOR4D statics
Just declaring as static const would give an initialization order fiasco since they were being used to initialize other statics.
This commit is contained in:
parent
edc05b5d54
commit
920120864f
|
@ -362,6 +362,6 @@ COLOR4D& COLOR4D::Saturate( double aFactor )
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
const COLOR4D COLOR4D::UNSPECIFIED( 0, 0, 0, 0 );
|
constexpr COLOR4D COLOR4D::UNSPECIFIED( 0, 0, 0, 0 );
|
||||||
const COLOR4D COLOR4D::WHITE( 1, 1, 1, 1 );
|
constexpr COLOR4D COLOR4D::WHITE( 1, 1, 1, 1 );
|
||||||
const COLOR4D COLOR4D::BLACK( 0, 0, 0, 1 );
|
constexpr COLOR4D COLOR4D::BLACK( 0, 0, 0, 1 );
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
* This program source code file is part of KICAD, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de
|
* Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de
|
||||||
* Copyright (C) 2017 Kicad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 2017-2019 Kicad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* Color class
|
* Color class
|
||||||
*
|
*
|
||||||
|
@ -53,7 +53,7 @@ public:
|
||||||
* @param aBlue is the blue component [0.0 .. 1.0].
|
* @param aBlue is the blue component [0.0 .. 1.0].
|
||||||
* @param aAlpha is the alpha value [0.0 .. 1.0].
|
* @param aAlpha is the alpha value [0.0 .. 1.0].
|
||||||
*/
|
*/
|
||||||
COLOR4D( double aRed, double aGreen, double aBlue, double aAlpha ) :
|
constexpr COLOR4D( double aRed, double aGreen, double aBlue, double aAlpha ) :
|
||||||
r( aRed ), g( aGreen ), b( aBlue ), a( aAlpha )
|
r( aRed ), g( aGreen ), b( aBlue ), a( aAlpha )
|
||||||
{
|
{
|
||||||
assert( r >= 0.0 && r <= 1.0 );
|
assert( r >= 0.0 && r <= 1.0 );
|
||||||
|
|
Loading…
Reference in New Issue