From 8f984c289955336187ed9616ba58d22d0cb0e24d Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 1 Jun 2018 17:00:17 +0200 Subject: [PATCH] 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. --- common/gal/opengl/opengl_gal.cpp | 8 ++++---- gerbview/gerbview_frame.cpp | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 0c99858d00..1c693abc7b 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KICAD, a free EDA CAD application. * * Copyright (C) 2012 Torsten Hueter, torstenhtr 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 * @@ -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 diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index 9a2b778474..f72e251dbf 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -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;