mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Make fullscreen cursor actually fullscreen
Very wide screens could see the edge of the cursor :)
This commit is contained in:
parent
61aeea9237
commit
d02358da2f
@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user