Don't show cursor or grid axes in pad preview; do show the pad anchor axes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15631
This commit is contained in:
parent
f48c125c3c
commit
31c88d1bcb
|
@ -334,20 +334,22 @@ void DIALOG_PAD_PROPERTIES::OnCancel( wxCommandEvent& event )
|
||||||
|
|
||||||
void DIALOG_PAD_PROPERTIES::prepareCanvas()
|
void DIALOG_PAD_PROPERTIES::prepareCanvas()
|
||||||
{
|
{
|
||||||
|
KIGFX::GAL_DISPLAY_OPTIONS opts = m_parent->GetGalDisplayOptions();
|
||||||
|
COLOR_SETTINGS* colorSettings = m_parent->GetColorSettings();
|
||||||
|
|
||||||
|
opts.m_forceDisplayCursor = false;
|
||||||
|
|
||||||
// Initialize the canvas to display the pad
|
// Initialize the canvas to display the pad
|
||||||
m_padPreviewGAL = new PCB_DRAW_PANEL_GAL( m_boardViewPanel, -1, wxDefaultPosition,
|
m_padPreviewGAL = new PCB_DRAW_PANEL_GAL( m_boardViewPanel, -1, wxDefaultPosition,
|
||||||
wxDefaultSize,
|
wxDefaultSize, opts,
|
||||||
m_parent->GetGalDisplayOptions(),
|
|
||||||
m_parent->GetCanvas()->GetBackend() );
|
m_parent->GetCanvas()->GetBackend() );
|
||||||
|
|
||||||
m_padPreviewSizer->Add( m_padPreviewGAL, 12, wxEXPAND | wxALL, 5 );
|
m_padPreviewSizer->Add( m_padPreviewGAL, 12, wxEXPAND | wxALL, 5 );
|
||||||
|
|
||||||
// Show the X and Y axis. It is useful because pad shape can have an offset
|
// Show the X and Y axis. It is useful because pad shape can have an offset
|
||||||
// or be a complex shape.
|
// or be a complex shape.
|
||||||
KIGFX::COLOR4D axis_color = LIGHTBLUE;
|
m_axisOrigin = new KIGFX::ORIGIN_VIEWITEM( colorSettings->GetColor( LAYER_GRID ),
|
||||||
|
KIGFX::ORIGIN_VIEWITEM::CROSS, 100000,
|
||||||
m_axisOrigin = new KIGFX::ORIGIN_VIEWITEM( axis_color, KIGFX::ORIGIN_VIEWITEM::CROSS,
|
|
||||||
pcbIUScale.mmToIU( 0.2 ),
|
|
||||||
VECTOR2D( m_previewPad->GetPosition() ) );
|
VECTOR2D( m_previewPad->GetPosition() ) );
|
||||||
m_axisOrigin->SetDrawAtZero( true );
|
m_axisOrigin->SetDrawAtZero( true );
|
||||||
|
|
||||||
|
@ -375,6 +377,7 @@ void DIALOG_PAD_PROPERTIES::prepareCanvas()
|
||||||
|
|
||||||
// And do not show the grid:
|
// And do not show the grid:
|
||||||
view->GetGAL()->SetGridVisibility( false );
|
view->GetGAL()->SetGridVisibility( false );
|
||||||
|
view->GetGAL()->SetAxesEnabled( false );
|
||||||
view->Add( m_previewPad );
|
view->Add( m_previewPad );
|
||||||
view->Add( m_axisOrigin );
|
view->Add( m_axisOrigin );
|
||||||
|
|
||||||
|
@ -1420,7 +1423,10 @@ void DIALOG_PAD_PROPERTIES::redraw()
|
||||||
if( !m_canUpdate )
|
if( !m_canUpdate )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
KIGFX::VIEW* view = m_padPreviewGAL->GetView();
|
KIGFX::VIEW* view = m_padPreviewGAL->GetView();
|
||||||
|
KIGFX::PCB_PAINTER* painter = static_cast<KIGFX::PCB_PAINTER*>( view->GetPainter() );
|
||||||
|
KIGFX::PCB_RENDER_SETTINGS* settings = painter->GetSettings();
|
||||||
|
|
||||||
m_padPreviewGAL->StopDrawing();
|
m_padPreviewGAL->StopDrawing();
|
||||||
|
|
||||||
// The layer used to place primitive items selected when editing custom pad shapes
|
// The layer used to place primitive items selected when editing custom pad shapes
|
||||||
|
@ -1428,10 +1434,10 @@ void DIALOG_PAD_PROPERTIES::redraw()
|
||||||
#define SELECTED_ITEMS_LAYER Dwgs_User
|
#define SELECTED_ITEMS_LAYER Dwgs_User
|
||||||
|
|
||||||
view->SetTopLayer( SELECTED_ITEMS_LAYER );
|
view->SetTopLayer( SELECTED_ITEMS_LAYER );
|
||||||
KIGFX::PCB_RENDER_SETTINGS* settings =
|
|
||||||
static_cast<KIGFX::PCB_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() );
|
|
||||||
settings->SetLayerColor( SELECTED_ITEMS_LAYER, m_selectedColor );
|
settings->SetLayerColor( SELECTED_ITEMS_LAYER, m_selectedColor );
|
||||||
|
|
||||||
|
m_axisOrigin->SetPosition( m_previewPad->GetPosition() );
|
||||||
|
|
||||||
view->Update( m_previewPad );
|
view->Update( m_previewPad );
|
||||||
|
|
||||||
// delete previous items if highlight list
|
// delete previous items if highlight list
|
||||||
|
|
Loading…
Reference in New Issue