OpenGL, DrawGrid(): use grid and axis alpha color value setting, instead of the fixed 1.0

In Cairo mode, this function uses already the alpha color value setting.
Now for low alpha values (usually they are low, as said in many GAL comments),
Cairo mode and OpenGL mode should have a similar look.
This commit is contained in:
jean-pierre charras 2018-06-01 17:00:17 +02:00
parent 3cf9009f73
commit 8f984c2899
2 changed files with 4 additions and 6 deletions

View File

@ -2,7 +2,7 @@
* 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-2016 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2012-2018 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2013-2017 CERN
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
@ -1004,7 +1004,7 @@ void OPENGL_GAL::DrawGrid()
if( axesEnabled )
{
glLineWidth( minorLineWidth );
glColor4d( axesColor.r, axesColor.g, axesColor.b, 1.0 );
glColor4d( axesColor.r, axesColor.g, axesColor.b, axesColor.a );
glBegin( GL_LINES );
glVertex2d( worldStartPoint.x, 0 );
@ -1060,7 +1060,7 @@ void OPENGL_GAL::DrawGrid()
}
else
{
glColor4d( gridColor.r, gridColor.g, gridColor.b, 1.0 );
glColor4d( gridColor.r, gridColor.g, gridColor.b, gridColor.a );
}
if( gridStyle == GRID_STYLE::SMALL_CROSS )
@ -1127,7 +1127,7 @@ void OPENGL_GAL::DrawGrid()
if( gridStyle == GRID_STYLE::DOTS )
{
glStencilFunc( GL_NOTEQUAL, 0, 1 );
glColor4d( gridColor.r, gridColor.g, gridColor.b, 1.0 );
glColor4d( gridColor.r, gridColor.g, gridColor.b, gridColor.a );
}
// Horizontal lines

View File

@ -925,8 +925,6 @@ void GERBVIEW_FRAME::SetVisibleElementColor( GERBVIEW_LAYER_ID aItemIdVisible,
break;
case LAYER_GERBVIEW_GRID:
// Ensure grid always has low alpha
aColor.a = 0.8;
SetGridColor( aColor );
m_colorsSettings->SetItemColor( aItemIdVisible, aColor );
break;