Disable hidpi cursors on GTK and OSX.

wxCursor scale factors won't be supported before wx 3.3.
MSW doesn't scale cursors, so it works as expected there.
This commit is contained in:
Alex Shvartzkop 2024-05-28 16:25:01 +03:00
parent 68fa45dea0
commit e3e63fb1b8
1 changed files with 10 additions and 1 deletions

View File

@ -662,7 +662,16 @@ void EDA_DRAW_PANEL_GAL::SetCurrentCursor( KICURSOR aCursor )
DPI_SCALING_COMMON dpi( nullptr, m_parent );
m_gal->SetNativeCursorStyle( aCursor, dpi.GetContentScaleFactor() >= 2.0 );
bool hidpi = false;
// Cursor scaling factor cannot be set for a wxCursor on GTK and OSX (at least before wx 3.3),
// resulting in 4x rendered size on 2x window scale.
// MSW renders the bitmap as-is, without scaling, so this works here.
#ifdef __WXMSW__
hidpi = dpi.GetContentScaleFactor() >= 2.0;
#endif
m_gal->SetNativeCursorStyle( aCursor, hidpi );
}