Collapse Redraw3DView and Update3DView into a single routine.

Also fixes some errors about what the flag meant (model changed,
NOT redraw immediately).

Fixes https://gitlab.com/kicad/code/kicad/issues/6478
This commit is contained in:
Jeff Young 2020-11-29 20:03:05 +00:00
parent 3ca06700fc
commit b171d381f0
6 changed files with 11 additions and 25 deletions

View File

@ -109,15 +109,8 @@ public:
* Update the 3D view, if the viewer is opened by this frame
* @param aTitle = the new title of the 3D frame, or nullptr
* to do not change the frame title
* @return false if the 3D view cannot be updated (because the
* owner of the viewer is not this frame)
*/
virtual void Update3DView( bool aForceReload, const wxString* aTitle = nullptr );
/**
* Request a redraw of 3D-Viewer canvas
*/
void Redraw3Dview();
virtual void Update3DView( bool aReloadRequest, const wxString* aTitle = nullptr );
/**
* Function LoadFootprint

View File

@ -360,7 +360,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
if( aSetDirtyBit )
frame->OnModify();
else
frame->Update3DView( false );
frame->Update3DView( true );
frame->UpdateMsgPanel();

View File

@ -78,7 +78,7 @@ EDA_3D_VIEWER* PCB_BASE_FRAME::Get3DViewerFrame()
}
void PCB_BASE_FRAME::Update3DView( bool aForceReload, const wxString* aTitle )
void PCB_BASE_FRAME::Update3DView( bool aReloadRequest, const wxString* aTitle )
{
EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
@ -87,17 +87,9 @@ void PCB_BASE_FRAME::Update3DView( bool aForceReload, const wxString* aTitle )
if( aTitle )
draw3DFrame->SetTitle( *aTitle );
draw3DFrame->NewDisplay( aForceReload );
}
}
if( aReloadRequest )
draw3DFrame->ReloadRequest();
void PCB_BASE_FRAME::Redraw3Dview()
{
EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
if( draw3DFrame )
{
draw3DFrame->Redraw();
}
}

View File

@ -1145,7 +1145,7 @@ void PCB_EDIT_FRAME::OnModify( )
{
PCB_BASE_FRAME::OnModify();
Update3DView( false );
Update3DView( true );
m_ZoneFillsDirty = true;
}

View File

@ -467,7 +467,7 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference )
}
if( requestRedraw3Dview )
editFrame->Redraw3Dview();
editFrame->Update3DView( true );
m_toolMgr->PostEvent( EVENTS::SelectedItemsMoved );
}
@ -1471,7 +1471,8 @@ int EDIT_TOOL::MoveExact( const TOOL_EVENT& aEvent )
[]( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool )
{
EditToolSelectionFilter( aCollector,
EXCLUDE_LOCKED | EXCLUDE_LOCKED_PADS | EXCLUDE_TRANSIENTS, sTool );
EXCLUDE_LOCKED | EXCLUDE_LOCKED_PADS | EXCLUDE_TRANSIENTS,
sTool );
} );
if( selection.Empty() )

View File

@ -624,7 +624,7 @@ int PCB_INSPECTION_TOOL::CrossProbePcbToSch( const TOOL_EVENT& aEvent )
else
m_frame->SendMessageToEESCHEMA( nullptr );
m_frame->Redraw3Dview();
m_frame->Update3DView( false );
return 0;
}
@ -649,7 +649,7 @@ int PCB_INSPECTION_TOOL::HighlightItem( const TOOL_EVENT& aEvent )
request3DviewRedraw = false;
if( request3DviewRedraw )
m_frame->Redraw3Dview();
m_frame->Update3DView( false );
return 0;
}