Don't set the viewport when switching screens.
That's the job of ZoomAutomatique(). Fixes: lp:1799436 * https://bugs.launchpad.net/kicad/+bug/1799436
This commit is contained in:
parent
df562b7ec0
commit
fec8ab372e
|
@ -1454,43 +1454,6 @@ void VIEW::UpdateAllItemsConditionally( int aUpdateFlags,
|
|||
}
|
||||
|
||||
|
||||
struct VIEW::extentsVisitor
|
||||
{
|
||||
BOX2I extents;
|
||||
bool first;
|
||||
|
||||
extentsVisitor()
|
||||
{
|
||||
first = true;
|
||||
}
|
||||
|
||||
bool operator()( VIEW_ITEM* aItem )
|
||||
{
|
||||
if( first )
|
||||
extents = aItem->ViewBBox();
|
||||
else
|
||||
extents.Merge( aItem->ViewBBox() );
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const BOX2I VIEW::CalculateExtents()
|
||||
{
|
||||
extentsVisitor v;
|
||||
BOX2I fullScene;
|
||||
fullScene.SetMaximum();
|
||||
|
||||
for( VIEW_LAYER* l : m_orderedLayers )
|
||||
{
|
||||
l->items->Query( fullScene, v );
|
||||
}
|
||||
|
||||
return v.extents;
|
||||
}
|
||||
|
||||
|
||||
std::unique_ptr<VIEW> VIEW::DataReference() const
|
||||
{
|
||||
auto ret = std::make_unique<VIEW>();
|
||||
|
|
|
@ -1528,16 +1528,15 @@ void SCH_EDIT_FRAME::ShowChangedLanguage()
|
|||
UpdateMsgPanel();
|
||||
}
|
||||
|
||||
|
||||
void SCH_EDIT_FRAME::SetScreen( BASE_SCREEN* aScreen )
|
||||
{
|
||||
EDA_DRAW_FRAME::SetScreen( aScreen );
|
||||
auto c = static_cast<SCH_DRAW_PANEL*>(m_canvas);
|
||||
c->DisplaySheet( static_cast<SCH_SCREEN*>( aScreen ) );
|
||||
auto bb = c->GetView()->CalculateExtents() ;
|
||||
BOX2D bb2 ( bb.GetOrigin(), bb.GetSize() );
|
||||
c->GetView()->SetViewport( bb2 );
|
||||
}
|
||||
|
||||
|
||||
const BOX2I SCH_EDIT_FRAME::GetDocumentExtents() const
|
||||
{
|
||||
int sizeX = GetScreen()->GetPageSettings().GetWidthIU();
|
||||
|
|
|
@ -651,8 +651,6 @@ public:
|
|||
void UpdateAllItemsConditionally( int aUpdateFlags,
|
||||
std::function<bool( VIEW_ITEM* )> aCondition );
|
||||
|
||||
const BOX2I CalculateExtents() ;
|
||||
|
||||
/**
|
||||
* Function IsUsingDrawPriority()
|
||||
* @return true if draw priority is being respected while redrawing.
|
||||
|
|
Loading…
Reference in New Issue