fix incorrect COLOR4D::COLOR4D( EDA_COLOR_T aColor ) ctor for UNDEFINED_COLOR

This commit is contained in:
jean-pierre charras 2017-02-23 18:17:47 +01:00
parent 039910cb21
commit 04d1b2fca7
1 changed files with 6 additions and 0 deletions

View File

@ -32,6 +32,12 @@ using namespace KIGFX;
COLOR4D::COLOR4D( EDA_COLOR_T aColor )
{
if( aColor <= UNSPECIFIED_COLOR || aColor >= NBCOLORS )
{
*this = COLOR4D::UNSPECIFIED;
return;
}
r = g_ColorRefs[aColor].m_Red / 255.0;
g = g_ColorRefs[aColor].m_Green / 255.0;
b = g_ColorRefs[aColor].m_Blue / 255.0;