Page layout editor: Fix bitmap bounding box
Fixes https://gitlab.com/kicad/code/kicad/issues/7315
This commit is contained in:
parent
7737489e57
commit
a6b2fb3819
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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…
Reference in New Issue