Fic bug #1475891 (Assertion failed when appending a board in pcbnew)

This commit is contained in:
jean-pierre charras 2015-07-19 11:18:07 +02:00
parent 3e0334a972
commit 1885a924d3
3 changed files with 10 additions and 5 deletions

View File

@ -124,6 +124,8 @@ void BLOCK_SELECTOR::SetMessageBlock( EDA_DRAW_FRAME* frame )
void BLOCK_SELECTOR::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
GR_DRAWMODE aDrawMode, EDA_COLOR_T aColor )
{
if( !aDC )
return;
int w = GetWidth();
int h = GetHeight();
@ -187,13 +189,14 @@ void DrawAndSizingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoin
block->SetMoveVector( wxPoint( 0, 0 ) );
if( aErase )
if( aErase && aDC )
block->Draw( aPanel, aDC, wxPoint( 0, 0 ), g_XorMode, block->GetColor() );
block->SetLastCursorPosition( aPanel->GetParent()->GetCrossHairPosition() );
block->SetEnd( aPanel->GetParent()->GetCrossHairPosition() );
block->Draw( aPanel, aDC, wxPoint( 0, 0 ), g_XorMode, block->GetColor() );
if( aDC )
block->Draw( aPanel, aDC, wxPoint( 0, 0 ), g_XorMode, block->GetColor() );
if( block->GetState() == STATE_BLOCK_INIT )
{

View File

@ -275,7 +275,7 @@ public:
m_new_name( aNewName ),
m_lib_candidate( aLibCandidate ) { }
RESCUE_CASE_CANDIDATE() {}
RESCUE_CASE_CANDIDATE() { m_lib_candidate = NULL; }
virtual wxString GetRequestedName() const { return m_requested_name; }
virtual wxString GetNewName() const { return m_new_name; }

View File

@ -297,7 +297,8 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
cancelCmd = true;
// undraw block outline
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
if( DC )
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
}
else
{
@ -326,7 +327,8 @@ bool PCB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
GetScreen()->m_BlockLocate.SetState( STATE_BLOCK_MOVE );
nextcmd = true;
m_canvas->SetMouseCaptureCallback( drawMovingBlock );
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
if( DC )
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
break;
case BLOCK_DELETE: // Delete