Draw fp grid layer swatch in proper scaling on hidpi.
This commit is contained in:
parent
f74d1060d4
commit
c2a80092d7
|
@ -354,7 +354,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow()
|
||||||
col_size = std::max( col_size, GetTextExtent( board->GetLayerName( layer ) ).x );
|
col_size = std::max( col_size, GetTextExtent( board->GetLayerName( layer ) ).x );
|
||||||
|
|
||||||
// Swatch and gaps:
|
// Swatch and gaps:
|
||||||
col_size += 26;
|
col_size += KiROUND( 14 * GetDPIScaleFactor() ) + 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_itemsGrid->IsColShown( col ) )
|
if( m_itemsGrid->IsColShown( col ) )
|
||||||
|
|
|
@ -369,7 +369,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataToWindow()
|
||||||
col_size = std::max( col_size, GetTextExtent( board->GetLayerName( layer ) ).x );
|
col_size = std::max( col_size, GetTextExtent( board->GetLayerName( layer ) ).x );
|
||||||
|
|
||||||
// Swatch and gaps:
|
// Swatch and gaps:
|
||||||
col_size += 26;
|
col_size += KiROUND( 14 * GetDPIScaleFactor() ) + 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_itemsGrid->IsColShown( col ) )
|
if( m_itemsGrid->IsColShown( col ) )
|
||||||
|
|
|
@ -72,7 +72,9 @@ void GRID_CELL_LAYER_RENDERER::Draw( wxGrid& aGrid, wxGridCellAttr& aAttr, wxDC&
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw the swatch
|
// draw the swatch
|
||||||
wxBitmap bitmap( 14, 14 );
|
int size = KiROUND( 14 * aDC.GetContentScaleFactor() );
|
||||||
|
wxBitmap bitmap( size, size );
|
||||||
|
|
||||||
LAYER_SELECTOR::DrawColorSwatch( bitmap,
|
LAYER_SELECTOR::DrawColorSwatch( bitmap,
|
||||||
cs->GetColor( ToLAYER_ID( LAYER_PCB_BACKGROUND ) ),
|
cs->GetColor( ToLAYER_ID( LAYER_PCB_BACKGROUND ) ),
|
||||||
cs->GetColor( ToLAYER_ID( value ) ) );
|
cs->GetColor( ToLAYER_ID( value ) ) );
|
||||||
|
|
Loading…
Reference in New Issue