Browse Source

3D viewer: use the full board bounding box to define the visible area.

Remove also a printf now useless, used for debug.

Fixes #4815
https://gitlab.com/kicad/code/kicad/issues/4815
pull/16/head
jean-pierre charras 5 years ago
parent
commit
eab98eee1d
  1. 10
      3d-viewer/3d_canvas/board_adapter.cpp
  2. 2
      pcbnew/class_pad.cpp

10
3d-viewer/3d_canvas/board_adapter.cpp

@ -277,13 +277,9 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
{
wxLogTrace( m_logTrace, wxT( "BOARD_ADAPTER::InitSettings" ) );
// Calculates the board bounding box
// First, use only the board outlines
EDA_RECT bbbox = m_board->ComputeBoundingBox( true );
// If no outlines, use the board with items
if( ( bbbox.GetWidth() == 0 ) && ( bbbox.GetHeight() == 0 ) )
bbbox = m_board->ComputeBoundingBox( false );
// Calculates the board bounding box (board outlines + items)
// to ensure any item, even outside the board outlines can be seen
EDA_RECT bbbox = m_board->ComputeBoundingBox( false );
// Gives a non null size to avoid issues in zoom / scale calculations
if( ( bbbox.GetWidth() == 0 ) && ( bbbox.GetHeight() == 0 ) )

2
pcbnew/class_pad.cpp

@ -330,7 +330,7 @@ void D_PAD::BuildEffectiveShapes() const
for( const std::shared_ptr<DRAWSEGMENT>& primitive : m_editPrimitives )
{
for( SHAPE* shape : primitive->MakeEffectiveShapes() )
{printf("shape %d\n", shape->Type());fflush(0);
{
shape->Rotate( -DECIDEG2RAD( m_Orient ) );
shape->Move( shapePos );
add( shape );

Loading…
Cancel
Save