Fix for Cursor rendering on Linux+EGL+Nvidia in accelerated graphics mode

EGL/NVidia can sometimes clip the cursor based on its plane regardless of the depth mask.  This avoids the issue by forcing the cursor up over the existing plane.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12183
This commit is contained in:
Addo White 2025-08-25 21:35:33 +00:00 committed by Seth Hillbrand
parent cc9ec7c01c
commit 843eea259d

View File

@ -2700,6 +2700,10 @@ void OPENGL_GAL::blitCursor()
glLineWidth( 1.0 );
glColor4d( color.r, color.g, color.b, color.a );
glMatrixMode( GL_PROJECTION );
glPushMatrix();
glTranslated( 0, 0, -0.5 );
glBegin( GL_LINES );
if( m_crossHairMode == CROSS_HAIR_MODE::FULLSCREEN_DIAGONAL )
@ -2743,6 +2747,8 @@ void OPENGL_GAL::blitCursor()
glEnd();
glPopMatrix();
if( depthTestEnabled )
glEnable( GL_DEPTH_TEST );
}