Make fullscreen cursor actually fullscreen

Very wide screens could see the edge of the cursor :)
This commit is contained in:
Seth Hillbrand 2025-08-22 20:15:59 -07:00
parent 61aeea9237
commit d02358da2f
2 changed files with 26 additions and 7 deletions

View File

@ -1198,13 +1198,22 @@ void CAIRO_GAL_BASE::blitCursor( wxMemoryDC& clientDC )
VECTOR2D p = ToScreen( m_cursorPosition );
const COLOR4D cColor = getCursorColor();
const int cursorSize = m_fullscreenCursor ? 8000 : 80;
wxColour color( cColor.r * cColor.a * 255, cColor.g * cColor.a * 255, cColor.b * cColor.a * 255,
255 );
clientDC.SetPen( wxPen( color ) );
clientDC.DrawLine( p.x - cursorSize / 2, p.y, p.x + cursorSize / 2, p.y );
clientDC.DrawLine( p.x, p.y - cursorSize / 2, p.x, p.y + cursorSize / 2 );
if( m_fullscreenCursor )
{
clientDC.DrawLine( 0, p.y, m_screenSize.x, p.y );
clientDC.DrawLine( p.x, 0, p.x, m_screenSize.y );
}
else
{
const int cursorSize = 80;
clientDC.DrawLine( p.x - cursorSize / 2, p.y, p.x + cursorSize / 2, p.y );
clientDC.DrawLine( p.x, p.y - cursorSize / 2, p.x, p.y + cursorSize / 2 );
}
}

View File

@ -2644,11 +2644,21 @@ void OPENGL_GAL::blitCursor()
m_compositor->SetBuffer( OPENGL_COMPOSITOR::DIRECT_RENDERING );
const int cursorSize = m_fullscreenCursor ? 8000 : 80;
VECTOR2D cursorBegin;
VECTOR2D cursorEnd;
VECTOR2D cursorCenter = m_cursorPosition;
VECTOR2D cursorBegin = m_cursorPosition - cursorSize / ( 2 * m_worldScale );
VECTOR2D cursorEnd = m_cursorPosition + cursorSize / ( 2 * m_worldScale );
VECTOR2D cursorCenter = ( cursorBegin + cursorEnd ) / 2;
if( m_fullscreenCursor )
{
cursorBegin = m_screenWorldMatrix * VECTOR2D( 0.0, 0.0 );
cursorEnd = m_screenWorldMatrix * VECTOR2D( m_screenSize );
}
else
{
const int cursorSize = 80;
cursorBegin = m_cursorPosition - cursorSize / ( 2 * m_worldScale );
cursorEnd = m_cursorPosition + cursorSize / ( 2 * m_worldScale );
}
const COLOR4D color = getCursorColor();