Browse Source

Page layout editor: Fix bitmap bounding box

Fixes https://gitlab.com/kicad/code/kicad/issues/7315
6.0.7
Mikolaj Wielgus 5 years ago
committed by Wayne Stambaugh
parent
commit
a6b2fb3819
  1. 4
      common/page_layout/ws_draw_item.cpp
  2. 1
      pagelayout_editor/pl_draw_panel_gal.cpp
  3. 2
      pagelayout_editor/pl_editor_frame.cpp

4
common/page_layout/ws_draw_item.cpp

@ -448,10 +448,6 @@ const EDA_RECT WS_DRAW_ITEM_BITMAP::GetBoundingBox() const
auto* bitmap = static_cast<const WS_DATA_ITEM_BITMAP*>( m_peer );
wxSize bm_size = bitmap->m_ImageBitmap->GetSize();
// bm_size is in Eeschema unit (100nm), convert to iu (0.001 mm)
bm_size.x /= 10;
bm_size.y /= 10;
EDA_RECT bbox;
bbox.SetSize( bm_size );
bbox.SetOrigin( m_pos.x - bm_size.x/2, m_pos.y - bm_size.y/2 );

1
pagelayout_editor/pl_draw_panel_gal.cpp

@ -107,6 +107,7 @@ void PL_DRAW_PANEL_GAL::DisplayWorksheet()
dummy.SetPaperFormat( &m_edaFrame->GetPageSettings().GetType() );
dummy.SetTitleBlock( &m_edaFrame->GetTitleBlock() );
dummy.SetProject( &m_edaFrame->Prj() );
dummy.SetMilsToIUfactor( IU_PER_MILS );
for( WS_DATA_ITEM* dataItem : model.GetItems() )
dataItem->SyncDrawItems( &dummy, m_view );

2
pagelayout_editor/pl_editor_frame.cpp

@ -850,7 +850,7 @@ WS_DATA_ITEM* PL_EDITOR_FRAME::AddPageLayoutItem( int aType )
}
// Set the scale factor for pl_editor (it is set for eeschema by default)
image->SetPixelSizeIu( 25400.0 / image->GetPPI() );
image->SetPixelSizeIu( IU_PER_MILS * 1000.0 / image->GetPPI() );
item = new WS_DATA_ITEM_BITMAP( image );
}
break;

Loading…
Cancel
Save