Better centreing of pin conflict map col labels.

This commit is contained in:
Jeff Young 2020-10-18 11:54:58 +01:00
parent 02cbcb99df
commit 9f16b68bde
2 changed files with 15 additions and 2 deletions

View File

@ -94,7 +94,11 @@ wxSize WX_ANGLE_TEXT::GetTextSize( wxWindow* aWindow, const wxString& aLabel )
{
// Create the font used for the text
wxFont font = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
font.SetPointSize( font.GetPointSize() + 2 ); // rotated text looks visually smaller
#ifdef __WXMAC__
// Rotated text looks visually smaller on OSX
font.SetPointSize( font.GetPointSize() + 2 );
#endif
// Measure the size of the text
wxClientDC dc( aWindow );

View File

@ -70,6 +70,14 @@ void PANEL_SETUP_PINMAP::ResetPanel()
}
#ifdef __WXMAC__
#define COL_LABEL_PLATFORM_FUDGE wxPoint( 5, 0 )
#elif __WXGTK3__
#define COL_LABEL_PLATFORM_FUDGE wxPoint( 0, 0 ) // TODO: needs testing...
#else
#define COL_LABEL_PLATFORM_FUDGE wxPoint( 0, -2 )
#endif
void PANEL_SETUP_PINMAP::reBuildMatrixPanel()
{
// Try to know the size of bitmap button used in drc matrix
@ -132,8 +140,9 @@ void PANEL_SETUP_PINMAP::reBuildMatrixPanel()
if( ( ii == jj ) && !m_initialized )
{
wxPoint txtpos;
txtpos.x = x + ( bmapSize.x / 2 );
txtpos.x = x + ( bmapSize.x / 2 ) - ( sqrt( 2 ) * txtSize.y / 2 );
txtpos.y = y - txtSize.y;
txtpos += COL_LABEL_PLATFORM_FUDGE;
new WX_ANGLE_TEXT( m_matrixPanel, wxID_ANY, CommentERC_V[ii], txtpos, 450 );
}